swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

AfterRequestListener错误 #1132

Open ChangeChe opened 4 years ago

ChangeChe commented 4 years ago
Q A
Bug report? yes
Feature request? yes
Swoft version 2.0.5
Swoole version 4.4.6
PHP version 7.2.4
Runtime environment CentOS 7

Describe the bug swoft/http-server/src/Listener/AfterRequestListener.php:34时不时会提示, 这个错误不能被HttpExceptionHandler捕获,HttpExceptionHandler已设置捕获的类型为\Throwable::class。

Uncaught Error: Call to undefined method Swoft\Http\Message\Request::send()

Details

[28-Nov-2019 11:19:00 Asia/Shanghai] PHP Fatal error:  Uncaught Error: Call to undefined method Swoft\Http\Message\Request::send() in /data1/work/houduan_online/myproject/www/vendor/swoft/http-server/src/Listener/AfterRequestListener.php:34
Stack trace:
#0 /data1/work/houduan_online/myproject/www/vendor/swoft/event/src/Manager/EventManager.php(727): Swoft\Http\Server\Listener\AfterRequestListener->handle(Object(Swoft\Event\Event))
#1 /data1/work/houduan_online/myproject/www/vendor/swoft/event/src/Manager/EventManager.php(322): Swoft\Event\Manager\EventManager->triggerListeners(Object(Swoft\Event\Listener\ListenerQueue), Object(Swoft\Event\Event), '')
#2 /data1/work/houduan_online/myproject/www/vendor/swoft/framework/src/Swoft.php(143): Swoft\Event\Manager\EventManager->trigger(Object(Swoft\Event\Event), NULL, Array)
#3 /data1/work/houduan_online/myproject/www/vendor/swoft/http-server/src/HttpDispatcher.php(90): Swoft::trigger('swoft.http.serv...', NULL, Object(Swoft\Http\Message\Response))
#4 /data1/work/houduan_online/comm in /data1/work/houduan_online/myproject/www/vendor/swoft/http-server/src/Listener/AfterRequestListener.php on line 34
sakuraovq commented 4 years ago

代码问题吧 方法都不存在了 composer update 下呢

ChangeChe commented 4 years ago

如果是代码的问题,肯定是必现的吧。现在不是必现的,只会在部分请求抛这个异常。

ChangeChe commented 4 years ago

image