Skip to content

Commit d7f4711

Browse files
bors[bot]Veetaha
andauthored
Merge #5841
5841: Gate stream.pipeline workaround on fixed versions of node r=matklad a=Veetaha Fixes the symptom of coder/code-server#1810 Original report here: #3167 (comment) Thanks to @hjfreyer for precise investigation :D Co-authored-by: Veetaha <[email protected]>
2 parents 81fa00c + 74ed42c commit d7f4711

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

editors/code/src/net.ts

+8
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ async function downloadFile(
134134

135135
await pipeline(srcStream, destFileStream);
136136

137+
// Don't apply the workaround in fixed versions of nodejs, since the process
138+
// freezes on them, the process waits for no-longer emitted `close` event.
139+
// The fix was applied in commit 7eed9d6bcc in v13.11.0
140+
// See the nodejs changelog:
141+
// https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V13.md
142+
const [, major, minor] = /v(\d+)\.(\d+)\.(\d+)/.exec(process.version)!;
143+
if (+major > 13 || (+major === 13 && +minor >= 11)) return;
144+
137145
await new Promise<void>(resolve => {
138146
destFileStream.on("close", resolve);
139147
destFileStream.destroy();

0 commit comments

Comments
 (0)