Title: SIGTERM handler does not run if there are no tasks running and exit code is always 0 · Issue #28502 · nodejs/node · GitHub
Open Graph Title: SIGTERM handler does not run if there are no tasks running and exit code is always 0 · Issue #28502 · nodejs/node
X Title: SIGTERM handler does not run if there are no tasks running and exit code is always 0 · Issue #28502 · nodejs/node
Description: Version: v11.15.0 Platform: Linux tsundberg-dev 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Subsystem: process To run the following tests paste them into index.js and run node index...
Open Graph Description: Version: v11.15.0 Platform: Linux tsundberg-dev 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Subsystem: process To run the following tests pas...
X Description: Version: v11.15.0 Platform: Linux tsundberg-dev 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Subsystem: process To run the following tests pas...
Opengraph URL: https://github.com/nodejs/node/issues/28502
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SIGTERM handler does not run if there are no tasks running and exit code is always 0","articleBody":"\u003c!--\r\nThank you for reporting a possible bug in Node.js.\r\n\r\nPlease fill in as much of the template below as you can.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify the affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you can.\r\n-->\r\n\r\n* **Version**: v11.15.0\r\n* **Platform**: Linux tsundberg-dev 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux\r\n* **Subsystem**: process\r\n\r\n\u003c!-- Please provide more details below this comment. -->\r\n---\r\nTo run the following tests paste them into `index.js` and run `node index.js; echo $?`\r\n\r\n---\r\n#### Case 1\r\nThe following results in an expected output:\r\n```node\r\nprocess.kill(process.pid, 'SIGTERM')\r\n```\r\nOutput:\r\n```\r\nTerminated\r\n143\r\n```\r\n---\r\n#### Case 2\r\nAdding a SIGTERM results in an exit code of 0, and the handler never runs:\r\n```node\r\nprocess.on('SIGTERM', () => {\r\n console.error('Handle ran!')\r\n process.exit(1)\r\n})\r\n\r\nprocess.kill(process.pid, 'SIGTERM')\r\n```\r\nOutput:\r\n```\r\n0\r\n```\r\n---\r\n#### Case 3\r\nAdding a timeout or some other task that keeps node alive results in the expected behavior:\r\n```node\r\nprocess.on('SIGTERM', () => {\r\n console.error('Handle ran!')\r\n process.exit(1)\r\n})\r\n\r\nprocess.kill(process.pid, 'SIGTERM')\r\n\r\nsetTimeout(() => {}, 100000)\r\n```\r\nOutput:\r\n```\r\nHandle ran!\r\n1\r\n```","author":{"url":"https://github.com/TrevorSundberg","@type":"Person","name":"TrevorSundberg"},"datePublished":"2019-07-01T23:10:52Z","url":"https://github.com/nodejs/node/issues/28502"}
| 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:8911b280-6288-e241-1036-fc3812bc133c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A482:35D054:427D76:56072A:6AED21C9 |
| html-safe-nonce | 365ed7dd9bd011e72c2144e04770fa6e71d925310fb8ad2adb9d86af1ac5e772 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDgyOjM1RDA1NDo0MjdENzY6NTYwNzJBOjZBRUQyMUM5IiwidmlzaXRvcl9pZCI6IjU5NTU3MDExNTk2NzY5NDQ4NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d5d30d0d8a73a8bc485d438a6da1877bce96404fe7e5444fa28e8fb85f1c940b |
| hovercard-subject-tag | issue:462949506 |
| 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/28502/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5c1b108b293417571a30cdadae1b2a45ee289a48438efe13c0bde5754542bd99/nodejs/node/issues/28502 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5c1b108b293417571a30cdadae1b2a45ee289a48438efe13c0bde5754542bd99/nodejs/node/issues/28502 |
| og:image:alt | Version: v11.15.0 Platform: Linux tsundberg-dev 4.18.0-20-generic #21~18.04.1-Ubuntu SMP Wed May 8 08:43:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Subsystem: process To run the following tests pas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TrevorSundberg |
| 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