Files
node/doc/api
Trivikram Kamat cede7e6740 ffi: do not abort when a Worker stops in a callback
Stopping a Worker while it is running an FFI callback aborted the whole
process with "Callbacks cannot throw an exception". This happened on
worker.terminate(), on process.exit() inside the callback, and when the
main thread exited while the Worker was in a callback, since exit
terminates all Workers.

All three stop the Worker by terminating execution, and InvokeCallback
treated the termination as a thrown exception. Check HasTerminated()
first and return a zeroed result so the native caller can unwind.
Callbacks that throw still abort.

Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
Assisted-by: claude:opus-5.5
PR-URL: https://github.com/nodejs/node/pull/66389
Fixes: https://github.com/nodejs/node/issues/66388
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-10-01 05:53:52 +00:00
..
…
…
2026-09-16 20:13:19 +02:00
2026-09-28 04:22:37 +00:00
…
2026-09-03 11:40:52 +02:00
2026-09-22 10:59:57 +02:00
…
2026-09-03 15:37:21 +00:00
2026-09-25 20:28:33 +00:00
…
2026-09-11 13:15:27 -04:00
2026-09-26 21:18:43 +00:00
2026-09-22 10:59:57 +02:00
…
2026-09-25 20:28:33 +00:00
2026-09-09 18:04:31 +02:00
…
…