Skip to content

Commit a0e58bf

Browse files
apapirovskikjin
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: nodejs#21051 Fixes: nodejs#20750 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9be7f75 commit a0e58bf

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
@@ -1892,7 +1892,7 @@ class Http2Stream extends Duplex {
18921892
}
18931893

18941894
// TODO(mcollina): remove usage of _*State properties
1895-
if (!this.writable) {
1895+
if (this._writableState.finished) {
18961896
if (!this.readable && this.closed) {
18971897
this.destroy();
18981898
return;

0 commit comments

Comments
 (0)