【发布时间】:2019-12-07 14:12:39
【问题描述】:
我正在使用 supervisord 来管理流程。
(避免僵尸进程,以及其他难以管理的进程)
假设我将运行使用多处理的 python 脚本。
from multiprocessing import Process
import time
def fetch():
while True:
time.sleep(1)
print("I'm still alive...")
def main():
processes = [
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
Process(target=fetch),
[And more process here...]
]
for process in processes:
process.start()
main()
上面的代码,fetch()创建许多处理并运行它。
在这种情况下,如果fetch()创建的进程成为僵尸进程,
supervisord 管理它?(例如自动终止和重启)
或者,只管理根进程?
谢谢。
【问题讨论】:
标签: python supervisord