-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I am working on something which requires the stream to be used for a longer period more than the default timeout. I have noticed that in Node version prior to v14, even though the request times out with ETIMEDOUT error, the other operations using that stream worked fine. I think in Node v14.0.0 this is not supported. As soon as there is a socket error, all other operations are suspended. I assume this is the PR for that change but I could be wrong.
I compared the timeout scenario used in this library with another http client axios. They remove the timeout reference as soon as a response is obtained from the server. Can we do a similar change here?
Eg:
currentRequest.once('error', handleRequestError)
.once('response', function handleResponse(response) {
// Clear timeout reference
currentRequest.removeAllListeners('timeout');
// Other operations
}
Or if someone can point me in the right direction, I can work on this fix.
Metadata
Metadata
Assignees
Labels
No labels