我使用php start.php start -d守护进程方式运行时,再php start.php stop就直接报错了 Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
(null)(): supplied resource is not a valid stream resource in file Unknown on line 0
(null)(): supplied resource is not a valid stream resource in file Unknown on line 0
框架本身有处理的
在
config/server.php
中,设置stop_timeout
这个就是安全重启的超时时间
我们设置的是
30s
如果在30秒内,没有执行完任务或者处理完请求,则会强制重启进程
反之,则会安全重启
我们之前专门测试过,处理请求过程中,执行
php start.php restart -d
,会卡住等待处理请求然后,安全重启
那如果在超过等待时 有新的计划任务到执行时间 是否不执行了
按照我的理解,新任务或者新请求,应该不会执行了
不过,你可以测试一下,其实很方便测试的
好的 我也测试一下
我使用php start.php start -d守护进程方式运行时,再php start.php stop就直接报错了 Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
Fatal error: Uncaught ErrorException: (null)(): supplied resource is not a valid stream resource in Unknown:0
Stack trace:
0 [internal function]: {closure}()
1 {main}
thrown in Unknown on line 0
(null)(): supplied resource is not a valid stream resource in file Unknown on line 0
(null)(): supplied resource is not a valid stream resource in file Unknown on line 0
swoole扩展影响的,禁用swoole试下
禁用swoole后解决了
发现一个问题,假设一个定时任务的执行频率每10秒1次,执行耗时是15秒,那么在stop的时候webman会继续把亏
欠的执行次数执行完才stop,这可能导致stop_timeout耗尽强制中断