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
Axios will not timeout on idle sockets #2143
Comments
I agree, an infinite fetching time can be problematic, especially if you expect a small response. My workaround is to use a cancel token.
|
Yes, I workaround it by just using the |
maybe it looks like #1752 |
this issue has been fixed in v0.19.0, please try it. |
@Alanscut I am no longer working on the project using the library. If it is fixed I will close the issue. |
This workaround worked for me, I'm on Axios 0.21.1. This has wreaked havoc in my production app. We were on Axios 0.19.x without any issues. Only after we upgraded to Axios 0.21.1 did troubles begin. It took me 3 days to isolate where the file descriptor and memory leak were coming from. |
@joquijada your fix requires the entire request to occur within that time. I believe the nice thing about node is it considers the time between bytes. |
This has been fixed with #3694 |
+2 cents to this issue:
|
Axios does not time out idle connections, this means if you're downloading for a long time and the TCP connection gets lost you'll be stuck downloading the snapshot and it won't fail or kill the command. This re-writes downloading to use axios cancelation source to kill the request after a specified idle timeout. It also fixes some issues plumbing the errors through the process. See axios/axios#2143 for more information
Axios does not time out idle connections, this means if you're downloading for a long time and the TCP connection gets lost you'll be stuck downloading the snapshot and it won't fail or kill the command. This re-writes downloading to use axios cancelation source to kill the request after a specified idle timeout. It also fixes some issues plumbing the errors through the process. See axios/axios#2143 for more information
Describe the bug
On nodejs the timeout mechanism does not work correctly.
It is only concerned with the time to receive the first byte.
If the server sends a few bytes across the socket, but leaves it open
the request will never timeout.
This only happens with node, not in the browser.
To Reproduce
Expected behavior
If a socket stops writing for long period of time, the request should timeout.
nodejs get requests can detect this. You need to use their
timeout
event instead of just using a timer.
https://nodejs.org/api/http.html#http_event_timeout
Environment:
Looking at the code, I believe this is independent of environment.
The text was updated successfully, but these errors were encountered: