Skip to content

Commit 70b8d4c

Browse files
authored
Merge branch 'nodejs:main' into test/cwd-agnostic-snapshots
2 parents 925bf24 + 1409ac4 commit 70b8d4c

File tree

10 files changed

+146
-34
lines changed

10 files changed

+146
-34
lines changed

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,32 @@ The externally maintained libraries used by Node.js are:
899899
written prior permission. M.I.T. makes no representations about the
900900
suitability of this software for any purpose. It is provided "as is"
901901
without express or implied warranty.
902+
903+
----------------------------------------------------------------------
904+
905+
File: sorttable.js (only for ICU4J)
906+
907+
The MIT Licence, for code from kryogenix.org
908+
909+
Code downloaded from the Browser Experiments section of kryogenix.org is
910+
licenced under the so-called MIT licence. The licence is below.
911+
912+
Copyright (c) 1997-date Stuart Langridge
913+
914+
Permission is hereby granted, free of charge, to any person obtaining a
915+
copy of this software and associated documentation files (the "Software"),
916+
to deal in the Software without restriction, including without limitation
917+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
918+
and/or sell copies of the Software, and to permit persons to whom the
919+
Software is furnished to do so, subject to the following conditions:
920+
921+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
922+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
923+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
924+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
925+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
926+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
927+
SOFTWARE.
902928
"""
903929

904930
- libuv, located at deps/uv, is licensed as follows:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ For information about the governance of the Node.js project, see
453453
**Vladimir Morozov** <<vmorozov@microsoft.com>> (he/him)
454454
* [VoltrexKeyva](https://github.com/VoltrexKeyva) -
455455
**Mohammed Keyvanzadeh** <<mohammadkeyvanzade94@gmail.com>> (he/him)
456+
* [watilde](https://github.com/watilde) -
457+
**Daijiro Wachi** <<daijiro.wachi@gmail.com>> (he/him)
456458
* [zcbenz](https://github.com/zcbenz) -
457459
**Cheng Zhao** <<zcbenz@gmail.com>> (he/him)
458460
* [ZYSzys](https://github.com/ZYSzys) -
@@ -717,8 +719,6 @@ For information about the governance of the Node.js project, see
717719
**Vladimir Kurchatkin** <<vladimir.kurchatkin@gmail.com>>
718720
* [vsemozhetbyt](https://github.com/vsemozhetbyt) -
719721
**Vse Mozhet Byt** <<vsemozhetbyt@gmail.com>> (he/him)
720-
* [watilde](https://github.com/watilde) -
721-
**Daijiro Wachi** <<daijiro.wachi@gmail.com>> (he/him)
722722
* [watson](https://github.com/watson) -
723723
**Thomas Watson** <<w@tson.dk>>
724724
* [whitlockjc](https://github.com/whitlockjc) -

doc/changelogs/CHANGELOG_V20.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,11 @@ This is a security release.
8989

9090
### Notable Changes
9191

92-
lib:
93-
9492
* (CVE-2025-55132) disable futimes when permission model is enabled (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/802>
9593
* (CVE-2025-59465) add TLSSocket default error handler (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/797>
96-
lib,permission:
9794
* (CVE-2025-55130) require full read and write to symlink APIs (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/760>
98-
src:
9995
* (CVE-2025-59466) rethrow stack overflow exceptions in async\_hooks (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/773>
100-
src,lib:
10196
* (CVE-2025-55131) refactor unsafe buffer creation to remove zero-fill toggle (Сковорода Никита Андреевич) <https://github.com/nodejs-private/node-private/pull/759>
102-
tls:
10397
* (CVE-2026-21637) route callback exceptions through error handlers (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/796>
10498

10599
### Commits

doc/changelogs/CHANGELOG_V22.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,11 @@ This is a security release.
7979

8080
### Notable Changes
8181

82-
lib:
83-
8482
* (CVE-2025-59465) add TLSSocket default error handler
8583
* (CVE-2025-55132) disable futimes when permission model is enabled
86-
lib,permission:
8784
* (CVE-2025-55130) require full read and write to symlink APIs
88-
src:
8985
* (CVE-2025-59466) rethrow stack overflow exceptions in async\_hooks
90-
src,lib:
9186
* (CVE-2025-55131) refactor unsafe buffer creation to remove zero-fill toggle
92-
tls:
9387
* (CVE-2026-21637) route callback exceptions through error handlers
9488

9589
### Commits

doc/changelogs/CHANGELOG_V24.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,11 @@ This is a security release.
6868

6969
### Notable Changes
7070

71-
lib:
72-
7371
* (CVE-2025-59465) add TLSSocket default error handler (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/797>
7472
* (CVE-2025-55132) disable futimes when permission model is enabled (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/748>
75-
lib,permission:
7673
* (CVE-2025-55130) require full read and write to symlink APIs (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/760>
77-
src:
7874
* (CVE-2025-59466) rethrow stack overflow exceptions in async\_hooks (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/773>
79-
src,lib:
8075
* (CVE-2025-55131) refactor unsafe buffer creation to remove zero-fill toggle (Сковорода Никита Андреевич) <https://github.com/nodejs-private/node-private/pull/759>
81-
tls:
8276
* (CVE-2026-21637) route callback exceptions through error handlers (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/796>
8377

8478
### Commits

doc/changelogs/CHANGELOG_V25.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,12 @@ This is a security release.
5252

5353
### Notable Changes
5454

55-
lib:
56-
5755
* (CVE-2025-59465) add TLSSocket default error handler (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/750>
58-
permission:
5956
* (CVE-2026-21636) add network check on pipe\_wrap connect (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/784>
6057
* (CVE-2025-55130) require full read and write to symlink APIs (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/760>
6158
* (CVE-2025-55132) disable futimes when permission model is enabled (RafaelGSS) <https://github.com/nodejs-private/node-private/pull/748>
62-
src:
6359
* (CVE-2025-59466) rethrow stack overflow exceptions in async\_hooks (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/773>
64-
src,lib:
6560
* (CVE-2025-55131) refactor unsafe buffer creation to remove zero-fill toggle (Сковорода Никита Андреевич) <https://github.com/nodejs-private/node-private/pull/759>
66-
tls:
6761
* (CVE-2026-21637) route callback exceptions through error handlers (Matteo Collina) <https://github.com/nodejs-private/node-private/pull/790>
6862

6963
### Commits

lib/internal/cluster/primary.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,12 @@ function queryServer(worker, message) {
271271
return;
272272

273273
const key = `${message.address}:${message.port}:${message.addressType}:` +
274-
`${message.fd}:${message.index}`;
275-
let handle = handles.get(key);
274+
`${message.fd}` + (message.port === 0 ? `:${message.index}` : '');
275+
const cachedHandle = handles.get(key);
276+
let handle;
277+
if (cachedHandle && !cachedHandle.has(worker)) {
278+
handle = cachedHandle;
279+
}
276280

277281
if (handle === undefined) {
278282
let address = message.address;
@@ -298,25 +302,30 @@ function queryServer(worker, message) {
298302
handle = new RoundRobinHandle(key, address, message);
299303
}
300304

301-
handles.set(key, handle);
305+
if (!cachedHandle) {
306+
handles.set(key, handle);
307+
}
302308
}
303309

304310
handle.data ||= message.data;
305311

306312
// Set custom server data
307-
handle.add(worker, (errno, reply, handle) => {
313+
handle.add(worker, (errno, reply, serverHandle) => {
314+
if (!errno) {
315+
handles.set(key, handle); // Update in case it was replaced.
316+
}
308317
const { data } = handles.get(key);
309-
310-
if (errno)
311-
handles.delete(key); // Gives other workers a chance to retry.
318+
if (!cachedHandle && errno) {
319+
handles.delete(key);
320+
}
312321

313322
send(worker, {
314323
errno,
315324
key,
316325
ack: message.seq,
317326
data,
318327
...reply,
319-
}, handle);
328+
}, serverHandle);
320329
});
321330
}
322331

lib/internal/cluster/round_robin_handle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,7 @@ RoundRobinHandle.prototype.handoff = function(worker) {
137137
this.handoff(worker);
138138
});
139139
};
140+
141+
RoundRobinHandle.prototype.has = function(worker) {
142+
return this.all.has(worker.id);
143+
};

lib/internal/cluster/shared_handle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ SharedHandle.prototype.remove = function(worker) {
4747
this.handle = null;
4848
return true;
4949
};
50+
51+
SharedHandle.prototype.has = function(worker) {
52+
return this.workers.has(worker.id);
53+
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const cluster = require('cluster');
5+
const assert = require('assert');
6+
7+
const acts = {
8+
WORKER1_SERVER1_CLOSED: { cmd: 'WORKER1_SERVER1_CLOSED' },
9+
WORKER2_SERVER1_STARTED: { cmd: 'WORKER2_SERVER1_STARTED' },
10+
WORKER1_SERVER2_CLOSED: { cmd: 'WORKER1_SERVER2_CLOSED' },
11+
};
12+
13+
if (cluster.isMaster) {
14+
const currentHost = '::';
15+
const worker1 = cluster.fork({
16+
WORKER_ID: 'worker1',
17+
HOST: currentHost,
18+
});
19+
let worker2;
20+
worker1.on('error', common.mustNotCall());
21+
worker1.on('message', onMessage);
22+
23+
function createWorker2() {
24+
worker2 = cluster.fork({
25+
WORKER_ID: 'worker2',
26+
HOST: currentHost,
27+
});
28+
worker2.on('error', common.mustNotCall());
29+
worker2.on('message', onMessage);
30+
}
31+
32+
function onMessage(msg) {
33+
switch (msg.cmd) {
34+
case acts.WORKER1_SERVER1_CLOSED.cmd:
35+
createWorker2();
36+
break;
37+
case acts.WORKER2_SERVER1_STARTED.cmd:
38+
worker1.send(acts.WORKER2_SERVER1_STARTED);
39+
break;
40+
case acts.WORKER1_SERVER2_CLOSED.cmd:
41+
worker1.kill();
42+
worker2.kill();
43+
break;
44+
default:
45+
assert.fail(`Unexpected message ${msg.cmd}`);
46+
}
47+
}
48+
} else {
49+
const WORKER_ID = process.env.WORKER_ID;
50+
function createServer() {
51+
return new Promise((resolve, reject) => {
52+
const net = require('net');
53+
const PORT = 8000;
54+
const server = net
55+
.createServer((socket) => {
56+
socket.end(
57+
`Handled by worker ${process.env.WORKER_ID} (${process.pid})\n`
58+
);
59+
})
60+
.on('error', (e) => {
61+
reject(e);
62+
});
63+
64+
server.listen(
65+
{
66+
port: PORT,
67+
host: process.env.HOST,
68+
},
69+
() => resolve(server)
70+
);
71+
});
72+
}
73+
(async () => {
74+
const server1 = await createServer();
75+
if (WORKER_ID === 'worker2') {
76+
process.send(acts.WORKER2_SERVER1_STARTED);
77+
} else {
78+
await createServer().catch(common.mustCall());
79+
await new Promise((r) => server1.close(r));
80+
process.send(acts.WORKER1_SERVER1_CLOSED);
81+
82+
process.on('message', async (msg) => {
83+
if (msg.cmd === acts.WORKER2_SERVER1_STARTED.cmd) {
84+
const server2 = await createServer();
85+
await new Promise((r) => server2.close(r));
86+
process.send(acts.WORKER1_SERVER2_CLOSED);
87+
} else {
88+
assert.fail(`Unexpected message ${msg.cmd}`);
89+
}
90+
});
91+
}
92+
})().then(common.mustCall());
93+
}

0 commit comments

Comments
 (0)