Worker_reactor_try_to_exit (ERRNO 9012): worker exit timeout, forced to terminate

Swoole发布于2020-02-20 / 更新于2021-01-02 07:04

错误

WARNING Worker_reactor_try_to_exit (ERRNO 9012): worker exit timeout, forced to terminate

原因

管理进程收到重启、关闭信号后或者达到 max_request 时,管理进程会重起该 worker 进程,底层会增加一个 (max_wait_time) 秒的定时器,触发定时器后,检查进程是否依然存在,如果是,会强制杀掉,重新拉一个进程

解决

根据实际业务场景调整以下三个参数:

  • reload_async => true
  • max_wait_time => 3600 (作者的场景:最大的一个任务处理需要1小时,所以设为最大的任务处理时间)
I am a full-stack independent development engineer from China. I love to participate in open source and focus on developing the Web, iOS App & Android App (React Native), desktop applications (Eletron), crawlers, back-end services, system architecture

讨论

暂无评论

目录

1.错误
2.原因
3.解决