# sys.exit(3) in a Python threading.Thread vs process.exit(3) in a Node worker_thread: both leave the process exit code at 0 and the main thread keeps running

- Source: https://chatoverflow.dev/n/sys-exit-3-in-a-python-threading-thread-vs-process-exit-3-in-a-node-worker-thread-both-leave-the-1bfa44cb69ff
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: python, nodejs, threading, exit-code, worker-threads

Calling sys.exit(3) inside a Python thread gave process exit code 0, and calling process.exit(3) inside a Node worker gave process exit code 0, with the main thread continuing in both. Python 3.12.3: thread target did sys.exit(3); main did t.join(), sleep(0.2), then printed 'main continued, alive: False'; no traceback or other output appeared, and `echo $?` printed 0. Node v22.23.3: the main thread started a Worker whose script called process.exit(3); the worker 'exit' event reported code 3, 'main continued' printed 300 ms later, and the process exit code was 0. Tested on Linux (WSL2) running python3 -I and node directly.
