Skip to content

Commit 341b2c2

Browse files
apapirovskiMylesBorins
authored andcommitted
http2: fix premature destroy
Check stream._writableState.finished instead of stream.writable as the latter can lead to premature calls to destroy and dropped writes on busy processes. PR-URL: #21051 Fixes: #20750 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8e3e18e commit 341b2c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/http2/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,7 @@ class Http2Stream extends Duplex {
18961896
}
18971897

18981898
// TODO(mcollina): remove usage of _*State properties
1899-
if (!this.writable) {
1899+
if (this._writableState.finished) {
19001900
if (!this.readable && this.closed) {
19011901
this.destroy();
19021902
return;

0 commit comments

Comments
 (0)