Skip to content
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 - ClientRequest emits hang up error instead of 'aborted' #15318

Closed
ronag opened this issue Sep 10, 2017 · 5 comments
Closed

http - ClientRequest emits hang up error instead of 'aborted' #15318

ronag opened this issue Sep 10, 2017 · 5 comments
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@ronag
Copy link
Member

ronag commented Sep 10, 2017

Currently, ClientRequest will emit an 'error' instead of 'aborted' when the connection is closed before response. Is that really correct?

https://github.com/nodejs/node/pull/15270/files#r137951611

@mscdex mscdex added http Issues or PRs related to the http subsystem. question Issues that look for answers. labels Sep 10, 2017
@mscdex
Copy link
Contributor

mscdex commented Sep 10, 2017

To me, 'aborted' indicates an explicit abort was requested at some point in the past. I don't think we should be emitting that same event if the server did not send back a complete response.

@ronag
Copy link
Member Author

ronag commented Sep 10, 2017

@mscdex: Currently the request object never fires the aborted event even though the docs state:

Emitted when the request has been aborted by the server and the network socket has closed.

The explicit abort is given by the abort event as stated by the docs:

Emitted when the request has been aborted by the client. This event is only emitted on the first call to abort().

@ronag
Copy link
Member Author

ronag commented Sep 10, 2017

The http/2 compat seems to fire the aborted event on the request object so there is at the least an inconsistency here.

@ronag
Copy link
Member Author

ronag commented Sep 10, 2017

Actually, the http/2 compat does the reverse, it fires aborted only on the request object, but not the response object (which kind of makes more sense to me).

@mcollina
Copy link
Member

can you please make an example of what happens in http and what happens in http2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants