From 3a34ebd81d4cd03284cba5c055cfa1b311504479 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Thu, 31 May 2018 10:39:19 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/21051 Fixes: https://github.com/nodejs/node/issues/20750 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/internal/http2/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 39430edee6ff4f..8f6c0c20b5b36c 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -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;