英文:
In what task state can AWS Fargate spot interruption happen?
问题
我找不到关于AWS在哪个任务状态下会中断Fargate spot任务的文档。
- 在 "provisioning"、"pending" 和 "deprovisioning" 状态下是否会发生中断?
- 中断是否只会发生在 "running" 状态下?
我之所以问这个问题,是因为我在Fargate spot上运行的代码运行时间少于1分钟(远远低于终止持续时间 - 从警告到任务被停止)。所以在我的情况下,如果中断只在 "running" 状态下发生,我就不需要担心处理中断。
英文:
I couldn't find a documentation on, in which task state does AWS interrupt a Fargate spot task ?
- Can interruption happen during "provisioning", "pending" and "deprovisioning" states as well ?
- Do interruptions only happen during "running" state ?
I ask this because I have a code running on Fargate spot but runtime is less than 1 minute (way below termination duration - from warning to task being stopped). So in my case if interruption happens during "running" state only, I wouldn't bother about handling interruption.
答案1
得分: 0
虽然我没有找到关于这个的任何文档,但我已经像以下这样解决了这个问题:
# 如果任务在被中断时处于运行/去配置状态,就无需重新提交,因为我们的任务只需要不到2分钟就能完成。AWS会在2分钟之前发出警告,而我们的任务会在任务实际停止之前完成。
if task_state.lower() == "running" or task_state.lower() == "deprovisioning":
run_task = False
对这个问题的回答将增加一般受众的知识,这就是为什么我会在这里留下这个问题的原因。
英文:
Although I haven't found any documentation on this, I have solved this like following:
# If task is in running/deprovisioning state when it was interrupted, no need to resubmit as our task takes less than 2 minutes to finish. AWS gives a 2 minutes warning and our task will finish before task is actually stopped
if task_state.lower() == "running" or task_state.lower == "deprovisioning":
run_task = False
An answer to this question will add to knowledge of general audience is why I will leave the question here.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论