Supervisord 在 2 分钟后为 asyncio (python) 任务发送 SIGKILL

Supervisord sending SIGKILL for an asyncio (python) task after 2 minutes

我在 python 中使用 Quart 和 asyncio 构建了一个 api。端点生成一个后台任务,该任务将 运行 至少持续 5 分钟,但 Supervisord 为该任务发送 SIGKILL 命令并中途终止它。

我看不出 supervisord 会杀死它的任何理由。

日志:

2020-05-06 09:37:53,791 INFO supervisord started with pid 9
2020-05-06 09:37:54,794 INFO spawned: 'web-app' with pid 12
2020-05-06 09:37:54,795 INFO spawned: 'push-service' with pid 13
2020-05-06 09:37:55,797 INFO success: web-app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-05-06 09:38:11,614 INFO success: push-service entered RUNNING state, process has stayed up for > than 16 seconds (startsecs)
2020-05-06 09:46:48,389 INFO exited: web-app (terminated by SIGKILL; not expected)
2020-05-06 09:46:49,393 INFO spawned: 'web-app' with pid 63
2020-05-06 09:46:50,394 INFO success: web-app entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

这里有什么问题?

任务占用大量内存,容器内存不足,因此任务中途被终止。

向容器添加更多内存解决了该问题。