GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix worker send error · nodejs/node@edf4298

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-child-process-fork-closed-channel-segfault.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-child-process-fork-closed-channel-segfault.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-closed-channel-segfault.js
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ const server = net
3131
.listen(0, function() {
3232
const worker = cluster.fork();
3333

34+
worker.on('error', function(err) {
35+
if (
36+
err.code !== 'ECONNRESET' &&
37+
err.code !== 'ECONNREFUSED' &&
38+
err.code !== 'EMFILE'
39+
) {
40+
throw err;
41+
}
42+
});
43+
3444
function send(callback) {
3545
const s = net.connect(server.address().port, function() {
3646
worker.send({}, s, callback);
@@ -66,7 +76,10 @@ const server = net
6676
send(function(err) {
6777
// Ignore errors when sending the second handle because the worker
6878
// may already have exited.
69-
if (err && err.code !== 'ERR_IPC_CHANNEL_CLOSED') {
79+
if (err && err.code !== 'ERR_IPC_CHANNEL_CLOSED' &&
80+
err.code !== 'ECONNRESET' &&
81+
err.code !== 'ECONNREFUSED' &&
82+
err.code !== 'EMFILE') {
7083
throw err;
7184
}
7285
});

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.