Title: node --process-timeout blames the main thread when exit waits on a blocked Worker · Issue #66360 · nodejs/node · GitHub
Open Graph Title: node --process-timeout blames the main thread when exit waits on a blocked Worker · Issue #66360 · nodejs/node
X Title: node --process-timeout blames the main thread when exit waits on a blocked Worker · Issue #66360 · nodejs/node
Description: Version main Platform All Subsystem src (--process-timeout) What steps will reproduce the bug? import { Worker } from 'node:worker_threads'; const worker = new Worker(` const { execFileSync } = require('node:child_process'); const { pare...
Open Graph Description: Version main Platform All Subsystem src (--process-timeout) What steps will reproduce the bug? import { Worker } from 'node:worker_threads'; const worker = new Worker(` const { execFileSync } = req...
X Description: Version main Platform All Subsystem src (--process-timeout) What steps will reproduce the bug? import { Worker } from 'node:worker_threads'; const worker = new Worker(` const { execFileSync...
Opengraph URL: https://github.com/nodejs/node/issues/66360
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node --process-timeout blames the main thread when exit waits on a blocked Worker","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nAll\n```\n\n### Subsystem\n\nsrc (`--process-timeout`)\n\n### What steps will reproduce the bug?\n\n```js\nimport { Worker } from 'node:worker_threads';\n\nconst worker = new Worker(`\n const { execFileSync } = require('node:child_process');\n const { parentPort } = require('node:worker_threads');\n parentPort.postMessage('blocking');\n execFileSync(process.execPath, ['-e', 'setTimeout(() => {}, 10_000)']);\n`, { eval: true });\n\nworker.once('message', () => {\n setTimeout(() => process.exit(0), 200);\n});\n```\n\nRun with\n```console\nnode --process-timeout=1s repro.js\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe message should say the process was already exiting, as it does when the same Worker blocks a natural exit (e.g. `worker.unref()` instead of `process.exit(0)`):\n\n```console\n(node:PID) Process timed out after 1s (--process-timeout). Exiting with code 124.\nThe process did not finish exiting after the event loop had stopped.\n```\n\nThe main thread is blocked, but only because the exit path is joining a Worker thread that is stuck in `execFileSync`, not because of a synchronous operation in user code.\n\n### What do you see instead?\n\n```console\n(node:PID) Process timed out after 1s (--process-timeout). Exiting with code 124.\nThe main thread did not respond within 2000ms. It is likely blocked in a synchronous native operation, e.g. child_process.execSync() or a native addon, so no JavaScript stack or resource information is available.\n```\n\n### Additional information\n\nThis is not specific to `process.exit()`. The same message appears when the process exits because of an uncaught exception or an unhandled rejection, e.g. replace `process.exit(0)` in the repro with `throw new Error('boom')` or `Promise.reject(new Error('boom'))`.","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-09-27T21:41:35Z","url":"https://github.com/nodejs/node/issues/66360"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a0822b39-9beb-ece3-39b5-6cf0fc123d3f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F6C:20309E:32ADD3:41F2B2:6AED1DD5 |
| html-safe-nonce | c9bb1164589579cbdcd67b935d7e806f2767a35a490c67a25dbf165122a3908a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjZDOjIwMzA5RTozMkFERDM6NDFGMkIyOjZBRUQxREQ1IiwidmlzaXRvcl9pZCI6IjQzOTM0OTEyMTQ3NDkyMTIxMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8e2e7227eb5328ba1965d43dfffc847edff8e646c1254a09cfc3a0fab378df55 |
| hovercard-subject-tag | issue:5606508490 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66360/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bf1e79ce715dece502fec0ee43bb98dff2fb2264daea7a8a3f1ad05d2ddc4d0b/nodejs/node/issues/66360 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bf1e79ce715dece502fec0ee43bb98dff2fb2264daea7a8a3f1ad05d2ddc4d0b/nodejs/node/issues/66360 |
| og:image:alt | Version main Platform All Subsystem src (--process-timeout) What steps will reproduce the bug? import { Worker } from 'node:worker_threads'; const worker = new Worker(` const { execFileSync } = req... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 707a24b346ac8a82878b9c084efaa38a997660cb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width