http-client icon indicating copy to clipboard operation
http-client copied to clipboard

the cause is either a fiber deadlock, or an incorrectly unreferenced/canceled watcher

Open sxllllll opened this issue 10 months ago • 3 comments

I found that when using http-client, an error will be thrown if the request times out. It is easy to cause deadlock, causing the memory to increase. Has anyone encountered this problem?

Why 😫

Image

Exception1: Uncaught AssertionError thrown in event loop callback Amp\Http\Client\Connection\Internal\Http2ConnectionProcessor::Amp\Http\Client\Connection\Internal\{closure} defined in /var/www/hiwaifu_php/vendor/amphp/http-client/src/Connection/Internal/Http2ConnectionProcessor.php:1580; use Revolt\EventLoop::setErrorHandler() to gracefully handle such exceptions: Stream watcher invoked after stream closed

Exception2: Event loop terminated without resuming the current suspension (the cause is either a fiber deadlock, or an incorrectly unreferenced/canceled watcher):

Image

Image

sxllllll avatar Feb 27 '25 06:02 sxllllll

http-client version :

Image

sxllllll avatar Feb 27 '25 07:02 sxllllll

Do you have a fully runnable reproduction case? Could you also please share the stack traces?

kelunik avatar Feb 27 '25 21:02 kelunik

Can you please try your code again with amphp/[email protected]. A regression in 1.2.2 may not have been throwing an exception when it should have, instead leaving the coroutine to hang, so that may have been the cause here.

trowski avatar Mar 16 '25 17:03 trowski