http2: no stream destroy while its data is on the wire#19002
http2: no stream destroy while its data is on the wire#19002addaleax wants to merge 2 commits intonodejs:masterfrom
Conversation
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Fixes: nodejs#18973
|
I think that CI was started for a different PR. |
|
@addaleax thanks for noticing. It seems like some times the CI window is just refreshed instead of starting a new CI even though everything is entered correct. I guess I did not notice it in that moment. |
src/node_http2.cc
Outdated
| } | ||
|
|
||
| bool Http2Session::HasWritesOnSocketForStream(Http2Stream* stream) { | ||
| for (const nghttp2_stream_write& wr : outgoing_buffers_) |
There was a problem hiding this comment.
Nit: can we put brackets around this multi-line block?
There was a problem hiding this comment.
@apapirovski Sure, done. We’re not that strict with that in the C++ parts usually
There was a problem hiding this comment.
I would prefer we were, haha. It's just easier to read :) Thanks!
|
|
||
| // Make sure the Http2Stream destructor works, since we don't clean the | ||
| // stream up like we would otherwise do. | ||
| process.on('exit', global.gc); |
There was a problem hiding this comment.
I'm not sure I fully get why the explicit gc is needed in this test. Could you elaborate? Are you just testing for a crash?
There was a problem hiding this comment.
@apapirovski Yea, I had to make changes to my original patch for this so that this gc() call wouldn’t crash in the destructor.
So yes, it’s not needed, it’s just an extra test
There was a problem hiding this comment.
Ok, awesome. Just wanted to make sure I wasn't missing anything. Thank you for replying. :)
|
Landed in 584cfc9 |
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
|
Should this be backported to |
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. PR-URL: nodejs#19002 Fixes: nodejs#18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
#18987
#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: #19181
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
#18987
#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: #19181
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: nodejs#19185 PR-URL: nodejs#19002 Fixes: nodejs#18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 Backport-PR-URL: #20456 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. PR-URL: nodejs#19002 Fixes: nodejs#18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
nodejs#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
nodejs#18987
nodejs#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
nodejs#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
nodejs#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
nodejs#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: nodejs#19181
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 Backport-PR-URL: #20456 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a `Http2Stream` write is completed after it is already destroyed. Instead, don’t destroy the stream in that case and wait for GC to take over. Backport-PR-URL: #19185 Backport-PR-URL: #20456 PR-URL: #19002 Fixes: #18973 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This fixes a crash that occurred when a
Http2Streamwriteis completed after it is already destroyed.
Instead, don’t destroy the stream in that case and wait for
GC to take over.
Fixes: #18973
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
http2