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: nodejs#21051
Fixes: nodejs#20750
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
apapirovski committed Jun 3, 2018
1 parent d528781 commit 7b6c428
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 7b6c428

Please sign in to comment.