Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcc6d54
lib: return directly if udp socket close before lookup
theanarkh Mar 1, 2024
5034363
src: fix --disable-single-executable-application
joyeecheung Feb 19, 2024
e992af8
test: skip SEA tests when SEA generation fails
joyeecheung Feb 26, 2024
5908c12
doc: clarify Corepack threat model
aduh95 Mar 1, 2024
9d2c039
test: remove flaky designation
lpinca Mar 2, 2024
20e0ba3
doc,module: clarify hook chain execution sequence
JakobJingleheimer Mar 2, 2024
87d2acc
doc: fix actual result of example is different in events
deokjinkim Mar 2, 2024
fcf235d
doc: add policy for distribution
GeoffreyBooth Mar 3, 2024
9617adc
Revert "build: fix warning in cares under GN build"
lpinca Mar 3, 2024
4d99797
lib: make sure close net server
theanarkh Mar 3, 2024
67e8001
meta: bump actions/setup-node from 4.0.1 to 4.0.2
dependabot[bot] Mar 3, 2024
e476cb4
meta: bump actions/download-artifact from 4.1.1 to 4.1.3
dependabot[bot] Mar 3, 2024
015a157
meta: bump actions/cache from 4.0.0 to 4.0.1
dependabot[bot] Mar 3, 2024
42ca545
meta: bump codecov/codecov-action from 4.0.1 to 4.1.0
dependabot[bot] Mar 3, 2024
78f38a0
meta: bump actions/upload-artifact from 4.3.0 to 4.3.1
dependabot[bot] Mar 3, 2024
10aaabd
meta: bump github/codeql-action from 3.23.2 to 3.24.6
dependabot[bot] Mar 3, 2024
57ba8f5
test: fix flaky http-chunk-extensions-limit test
Ethan-Arrowood Mar 3, 2024
23c32ab
build: respect the `NODE` env variable in `Makefile`
aduh95 Mar 3, 2024
625c9e0
benchmark: update iterations of benchmark/domain/domain-fn-args.js
Mar 4, 2024
0dfe810
benchmark: update iterations of benchmark/async_hooks/async-local-
Mar 4, 2024
5864534
deps: update nghttp2 to 1.60.0
nodejs-github-bot Mar 5, 2024
fd86ea8
Revert "build: workaround for node-core-utils"
richardlau Mar 5, 2024
fff7f48
test: reduce flakiness of `test-runner-output`
aduh95 Mar 5, 2024
7ff3551
build: fix arm64 host cross-compilation in GN
zcbenz Feb 28, 2024
85aa6ca
Revert "test_runner: do not invoke after hook when test is empty"
cjihrig Mar 7, 2024
bee3b36
test: add regression test for test_runner after hook
cjihrig Mar 7, 2024
a48c9ca
stream: do not defer construction by one microtick
mcollina Mar 7, 2024
84c7e6f
2024-03-08, Version 21.7.1 (Current)
targos Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stream: do not defer construction by one microtick
Fixes: #51993
PR-URL: #52005
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
mcollina authored and targos committed Mar 8, 2024
commit a48c9ca0dbe333b7560592cbd880d78b0f8e8906
6 changes: 1 addition & 5 deletions lib/internal/streams/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function constructNT(stream) {
} else if (err) {
errorOrDestroy(stream, err, true);
} else {
process.nextTick(emitConstructNT, stream);
stream.emit(kConstruct);
}
}

Expand All @@ -304,10 +304,6 @@ function constructNT(stream) {
}
}

function emitConstructNT(stream) {
stream.emit(kConstruct);
}

function isRequest(stream) {
return stream?.setHeader && typeof stream.abort === 'function';
}
Expand Down
28 changes: 28 additions & 0 deletions test/parallel/test-fs-writestream-open-write.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const common = require('../common');
const tmpdir = require('../common/tmpdir');
const { strictEqual } = require('assert');
const fs = require('fs');

// Regression test for https://github.com/nodejs/node/issues/51993

tmpdir.refresh();

const file = tmpdir.resolve('test-fs-writestream-open-write.txt');

const w = fs.createWriteStream(file);

w.on('open', common.mustCall(() => {
w.write('hello');

process.nextTick(() => {
w.write('world');
w.end();
});
}));

w.on('close', common.mustCall(() => {
strictEqual(fs.readFileSync(file, 'utf8'), 'helloworld');
fs.unlinkSync(file);
}));