fix: respect process.exitCode#41
Conversation
6bf3940 to
9eb516e
Compare
9eb516e to
db42728
Compare
|
AI review: The Problem with the Current PatchThe patch always prioritizes
This loses important information about how the process died. Unix convention uses Better ApproachThe intention should probably be more nuanced: // Respect process.exitCode for graceful exits, but preserve signal info for real signals
const exitCode = (signal > 0)
? 128 + signal // Real signal - preserve signal-based exit code
: (typeof process.exitCode === 'number' || typeof process.exitCode === 'string')
? process.exitCode
: 0;Or alternatively, only respect const exitCode = (signal === 0 || signal === -128) // exit event or gracefulExit
? (typeof process.exitCode === 'number' || typeof process.exitCode === 'string')
? process.exitCode
: 0
: 128 + signal;The QuestionShould |
aff90fd to
1cada42
Compare
|
The current failure on node 20 is happening for me even in function flushSync() {
workerStdio.stdout[kStdioWantsMoreDataCallback]();
workerStdio.stderr[kStdioWantsMoreDataCallback]();
}which comes from node internals: https://github.com/nodejs/node/blob/34cb10b4a25a920b9d38daff64ce4467a996bfc5/lib/internal/bootstrap/switches/is_not_main_thread.js#L49 |
|
You can just update here. |
15b2d6c to
6abc3f4
Compare
|
This seems to have changed the behavior of process.exitCode = 1
gracefulExit()Edit: Sorry, I should have checked the issues first. I went digging into source right away. See #42 |
Fixes #40