| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
IncomingMessage overrides destroy() which kind of blocks any effort in this regards. That needs to IMO be fixed first. |
Sorry, something went wrong.
Thanks, @ronag, for the suggestion. I'll look into it. There is an issue with destroy for sure. When using keep-alive, we don't want to destroy the socket, and that's what's happening by just setting the option to true. |
Sorry, something went wrong.
|
Sorry if this is taking a long time, but I am trying to figure out what's wrong 🙏 Removing the override of destroy() resolves the EECONRESET errors, fewer tests are failing, but request is emitting close twice, and some connections seem to hang. |
Sorry, something went wrong.
|
The changes made here are overriding the ones you made recently, @ronag . I don't know if this approach is the best. PS: just rebased against master on the last forced push. |
Sorry, something went wrong.
There was a problem hiding this comment.
Please also try to remove all cases of manually managing destroyed and emitting 'close' on IncomingMessage. Having some kind of hybrid solution will make things hard to maintain IMO.
Sorry, something went wrong.
You mean like in here? I agree, that is also the reason why the callback is not called in all cases in _destroy. I also agree that it is ugly, sorry. I wasn't sure I could change the _http_server.js parts. Thanks for the pointers. |
Sorry, something went wrong.
|
Do we need to keep this behavior? If we do, I think it would be better to implement the destroy logic directly in IncomingMessage and not reusing the general lib/internal/streams/destroy.js implementation as I did. Overriding that implementation causes a lot of tests to fail because they are expecting an unhandled error. Also, do you have anything against adding an abort method on IncomingMessage? |
Sorry, something went wrong.
Yes, just call destroy and move the logic there?
I disagree. We should implement it as a regular destroy.
Can still be an unhandeld error?
Yes, destroy should be abort. We just deprecated abort on ClientRequest in favor of destroy. |
Sorry, something went wrong.
Ok.
I agree. The only difference I have seen with a regular destroy is that IncomingMessage emits an error only if there are listeners attached, at least when aborting.
Got it. |
Sorry, something went wrong.
I can help with sorting this out. If you have any test that depends on this behavior just comment them out and we can take a look together when that's the only thing remaining. |
Sorry, something went wrong.
|
Sorry if it took me a while: |
Sorry, something went wrong.
|
Sorry to revive an ancient discussion, but what how did you intend client aborts to be handled after this change? It looks like currently the only way is to listen on close of responses and check if writableFinished is set to false. I opened #46666 and more or less completely forgot about it 😅, since it didn't get any attention I wrote something myself, but I'm not sure if the current way should just be documented, or if the abort event should be called again. Maybe you can chime in? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Enable the default autoDestroy: true option in IncomingMessage.
Refactor _http_client and _http_server to remove any manual destroying/closing of IncomingMessage.
Refactor IncomingMessage destroy method to use the standard implementation of the stream module and move the abort logic
inside of it.
Ref:
#30625
Checklist