-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http adapter stream never ends and request hangs #3798
Comments
@AaronRobinson Have you come up with a workaround for this at all? We've been using Axios for years and all of a sudden 2 days ago this has become a huge issue for us out of nowhere without upgrading or changing anything. I've debugged it down to the same thing, that the Axios promise just doesn't resolve (even though the network request is actually made and does respond). I have to repeatedly restart the app until it stops happening so I assume there's some sort of network connection being made initially that gets corrupted and then is kept alive in the background or something like that? I don't know. |
@danconnell i didn’t solve it but I’m not convinced it’s an axios issue. My best guess is that somewhere between axios and the target server doesn’t send all the packets as I have debugged that axios never gets the end event. There's plenty online describing this behaviour including some specific cases where axios doesn't deal with it as expected. For the record I was using node->axios with socks-proxy-agent as the httpsagent->tor->target. I was also doing limited (20-50) concurrent requests (using p-limit). So it’s possible that any combination of NodeJS, the socks lib or tor itself couldn’t cope. I also later discovered that on occasion the server running this code would become CPU saturated and so that could have had an impact. Since moving to multiple node runtimes with serial requests I haven't had the issue yet. |
I came across a similar issue in my handcrafted HTTP client and what fixed the issue for me was handling the The Node.js http module documentation says:
It means that the
I was thinking about replacing my client with Axios and I wanted to check if the library handles the Axios is only listening on Edit: It seems like Node.js v13 introduced a change around the events that are emitted on the response object -nodejs/node#31630 |
Hi! Environment:
Sorry if the following is misguided. I'm guessing the same as @janaz. As said in the following issue, aborted stream is not successful, so Just to be sure, checked the Node.js source code... If possible, how about adding Lines 242 to 266 in 199c8aa
(One thing that bothers me is why Thank you. |
My theory on the timeout is that it's based on the initial response so if some data is received but not all it will no longer timeout. I have no evidence to back this up. |
Oh, by the way... I understand the behavior 🙌 Thank you. |
I found
I still think to need |
I am having the same problem. Happens very sporadically. |
Describe the bug
Intermittent hangs with requests that I've debugged down to end not being called on the stream.
To Reproduce
Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question
Excerpts from my code showing the Axios call
Axios http.js with debug messages added
Expected behavior
It doesn't hang or it times out
Environment
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: