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.

PR-URL: #21051
Fixes: #20750
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
apapirovski authored and MylesBorins committed Jun 6, 2018
1 parent 8e3e18e commit 341b2c2
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 @@ -1896,7 +1896,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 341b2c2

Please sign in to comment.