ECS Fargate task stop with a message on the web console: Your Spot Task was interrupted.

0

Hello developers,

I had initiated a SPOT ECS Fargate task which stopped after running sometime with a message (JS Code is written in node:14-alpine): "Your Spot Task was interrupted."

Task Docker Container: FROM node:14-alpine Code: NodeJS

However, my process.on code didn't fire-up:

process.on('SIGTERM', async () => { console.log("The service is about to shut down!"); process.exit(0); });

Any clue why code didn't capture the "SIGTERM" event?

FYI: I know there is a way to capture these events using EventBridge: https://repost.aws/knowledge-center/fargate-spot-termination-notice, however, curious to know why code didn't pick "SIGTERM" event.

已提問 5 個月前檢視次數 95 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南