Skip to content

Connection timeout for long running streams #9

@vaditya92

Description

@vaditya92

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions