踩坑教训

Swoole onClose handler error. Http onRequest handler error.

By karp 3149701 Views 3 MIN READ 0 Comments

接口调用一个不存在的 类 长时间不回显.

客户端主动断链
抛错 PHP Warning: SwooleServer::start(): onClose handler error
接下来再次请求 直接不回包

抛错 PHP Warning: SwooleServer::start(): Http onRequest handler error.

请求其他正常接口 仍不回显, 抛上述错误.

再次请求这个进程仍是抛错 直到 worker 进程死掉才会抛

PHP Warning: SwooleServer::start(): onWorkerStop handler error
PHP Fatal error: Uncaught Error: Class 'ControllerWebTest' not found

抛错:

PHP Warning:  Swoole\Server::start(): onClose handler error. 
PHP Warning:  Swoole\Server::start(): Http onRequest handler error. 

解决方式 :

当前版本 4.2.13
更新至最新版本 4.4 问题应该就解决了 yum install php72-php-pecl-swoole4

除了升级最好自己在最外层try catchthrowable

throwable = Error + Exception 捕获的更加全

本文由 karp 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://www.ikarp.top/index.php/archives/444.html

标签: swoole

0 评论