Skip to content

Commit

Permalink
http2: fix premature destroy
Browse files Browse the repository at this point in the history
Check stream._writableState.finished instead of stream.writable
as the latter can lead to premature calls to destroy and dropped
writes on busy processes.

Backport-PR-URL: #22850
PR-URL: #21051
Fixes: #20750
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
apapirovski authored and BethGriggs committed Oct 16, 2018
1 parent 322f39d commit 3c8c53f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ class Http2Stream extends Duplex {
}

// TODO(mcollina): remove usage of _*State properties
if (!this.writable) {
if (this._writableState.finished) {
if (!this.readable && this.closed) {
this.destroy();
return;
Expand Down

0 comments on commit 3c8c53f

Please sign in to comment.