swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

WARNING Worker_reactor_try_to_exit() (ERRNO 9101): worker exit timeout, forced termination

Open z6824980 opened this issue 3 years ago • 1 comments

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error. 看文档说明,这个是因为 在约定的时间 (max_wait_time 秒) 内此 Worker 没有退出,Swoole 底层强行终止此进程。

我这边设置了: 'reload_async' => true, 'max_wait_time' => 10, 'max_request' => 50000,

  1. What did you expect to see? 是不是调大max_wait_time的时间,可以在一定程度上避免这种警告?

  2. What did you see instead? WARNING Worker_reactor_try_to_exit() (ERRNO 9101): worker exit timeout, forced termination

image

  1. What version of Swoole are you using (show your php --ri swoole)? php7.2 swoole4.8.8

  2. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

z6824980 avatar Aug 10 '22 02:08 z6824980

是的,但是最好看一下代码,因为max_wait_time设置为10秒这么长都出现这个警告,而且有死锁发生。

NathanFreeman avatar Aug 10 '22 03:08 NathanFreeman

注册onWorkerExit事件回调,然后在这个函数中清理进程内的定时器、任务协程、事件监听等可能会挂起进程的逻辑

matyhtf avatar Aug 10 '22 23:08 matyhtf