| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This isn't an event on Readable.
Sorry, something went wrong.
There was a problem hiding this comment.
There's a race condition where pause can get evaluated in between resume being called and actually running (basically after resumeScheduled: true and before nextTick). This fixes it and passes all our tests (plus a new one that failed before).
Sorry, something went wrong.
There was a problem hiding this comment.
we should not create a closure here, but rather use a top level function and pass the stream in there.
Sorry, something went wrong.
There was a problem hiding this comment.
I can remove these comments but I wanted it clear that these two don't run as things are. It's a bit confusing otherwise.
Sorry, something went wrong.
There was a problem hiding this comment.
@jasnell can we remove those then? Or do you prefer if we add 'close' to Http2Stream?
Sorry, something went wrong.
There was a problem hiding this comment.
I'm good with removing the comments.
Sorry, something went wrong.
There was a problem hiding this comment.
oh lol... heh Matteo pointed out that I didn't understand the comments :-) This is true, I missed that.
I'm thinking we need to refactor this so that streamClosed and close are one and the same and that close is emitted appropriately. The one bit we'd have to account for is the code that is reported in streamClosed
Sorry, something went wrong.
There was a problem hiding this comment.
I could be wrong but I think @mcollina is asking about removing the functions which the comments refer to. If a 'close' event will be added to Http2Stream at some point then they should be kept but if that's not going to happen then we can safely remove. too slow lol
Sorry, something went wrong.
There was a problem hiding this comment.
writable is currently always true since Http2Stream doesn't emit a 'close' event but also this seems more correct, as far as I can reason about it and compare it to http1.
Sorry, something went wrong.
There was a problem hiding this comment.
👍
Sorry, something went wrong.
There was a problem hiding this comment.
Any bind in here is expensive. I think only binding the most crucial things that are almost guaranteed to run (that being onfinish) is smart.
Sorry, something went wrong.
There was a problem hiding this comment.
I would remove setting writable = false. This would break pump. See #15029
Sorry, something went wrong.
There was a problem hiding this comment.
Good work, a couple of nits.
Sorry, something went wrong.
There was a problem hiding this comment.
we should not create a closure here, but rather use a top level function and pass the stream in there.
Sorry, something went wrong.
Handle edge case where stream pause is called between resume being called and actually evaluated. Other minor adjustments to avoid various edge cases around stream events. Add new tests that cover all changes. Fixes: nodejs#15491
|
Thanks for the review! Great spot re: the closure. All fixed now and ready for review/CI. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Sorry, just to confirm — anything I need to change or is this approved? Thanks! (Want to make sure this gets into 8.6.0 since without it people can't use HTTP2 compatibility layer very well, at least not for sending bigger amounts of data.) Also, looks like CI was all good — failures are related to existing known issues reported elsewhere. |
Sorry, something went wrong.
|
@apapirovski I understood @jasnell would like to have https://github.com/nodejs/node/pull/15503/files#r140291319 sorted before landing. IMHO leaving around functions that are not called is not a good thing. We can land this as it is right now, and send another PR to fix the 'streamClosed' problem, I'm ok with that as well. @jasnell what do you think? |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
I mean, this PR didn't change that behaviour (it just documents it) and it fixes a legitimate, serious bug. Would be nice to get it into 8.6.0. I can't imagine we'll have a resolution for standardizing streamClosed and close before then. (I'm happy to take a look at that next btw.) |
Sorry, something went wrong.
|
I'm good with getting this landed now and included in 8.6.0, we can resolve the other issues separately |
Sorry, something went wrong.
Handle edge case where stream pause is called between resume being called and actually evaluated. Other minor adjustments to avoid various edge cases around stream events. Add new tests that cover all changes. Fixes: #15491 PR-URL: #15503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
cherry-picking into v8.x-staging next |
Sorry, something went wrong.
Handle edge case where stream pause is called between resume being called and actually evaluated. Other minor adjustments to avoid various edge cases around stream events. Add new tests that cover all changes. Fixes: #15491 PR-URL: #15503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in v8.x-staging... |
Sorry, something went wrong.
Handle edge case where stream pause is called between resume being called and actually evaluated. Other minor adjustments to avoid various edge cases around stream events. Add new tests that cover all changes. Fixes: #15491 PR-URL: #15503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Handle edge case where stream pause is called between resume being called and actually evaluated. Other minor adjustments to avoid various edge cases around stream events. Add new tests that cover all changes. Fixes: nodejs/node#15491 PR-URL: nodejs/node#15503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
This PR is mostly about fixing #15491 but also includes some minor changes to improve overall reliability of the various stream events. Test cases for everything are included. (Some notes to follow directly in code.)
Thanks for reviewing!
cc @mcollina, @jasnell
Checklist
Affected core subsystem(s)
http2, test