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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • 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
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.