-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Server side aborted request in stream mode hang with node 14.3.0 #1295
Comments
This is causing the test "throws an error if the server aborted the request" to fail. These Node.JS commits (merged into 14.3.0) could be relevant to this issue: |
The problem seems to be with the get aborted(): boolean {
return (this[kRequest]?.destroyed ?? this.destroyed) && !(this[kOriginalResponse]?.complete);
} or, at least, the way it's used here: response.once('aborted', () => {
if (this.aborted) {
return;
} |
has been fixed in 14.3.0 |
But it shouldn't be breaking imo |
What's the |
But there's a difference here: Node.JS 14.2.0: |
I can confirm the fix is functional. Many thanks to @Giotino & @szmarczak ! |
Describe the bug
Server side aborted requests in stream mode conduce got to hang with node >= 14.3.0. In fact the
aborted
event from theIncomingMessage
is not transmitted or transformed to an error in the stream got returns.Code to reproduce
Node output
14.3.0
14.2.0
Comments
With node 14.2.0 we can see when the request is aborted that an error in thrown from the
for await
loop. We can see theend
message too signaling the request is terminated. With node 14.3.0, no error is thrown and the stream is not terminated, we are stuck in thefor await
loopWorkaround
It's possible to use this workaround to restore the previous behavior (but we get a
got.RequestError
and not more agot.ReadError
):Checklist
The text was updated successfully, but these errors were encountered: