Repository navigation
fix(node): stop aborting on codec callbacks queued at process exit - #1635
willkill07 merged 1 commit into
Conversation
- carry threadsafe callback replies in call payloads via `reply_tsfn` and `call_with_reply` in `callable.rs` - route scoped execution, conditional gate, and plugin validate and register callbacks through `call_with_reply` in `api/mod.rs` - keep codec threadsafe function unreferenced and refuse queued calls after process exit via `mark_env_exiting_on_process_exit` in `promise_call.rs` - remove unused middleware wrappers, threadsafe function builders, macro wrapper parameters, and closed-callback test hooks - add reply callback factory and `__testClosedReplyCallback` hook - add child-process exit test in `llm_tests.mjs` Signed-off-by: Greyson Lalonde <[email protected]>
|
No actionable comments were generated in the recent review. WalkthroughNode callback paths now use reply-capable threadsafe functions for scoped execution, conditional gates, plugin callbacks, and codecs. The Node process exit event marks the environment as exiting. Callback queue refusals use the reply-call result path, and tests cover closed callbacks and queued codec work during shutdown. ChangesNode callback and shutdown flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant NodeProcess
participant mark_env_exiting_on_process_exit
participant env_teardown_flag
participant JsCodecCallback
participant ReplyTsfn
NodeProcess->>mark_env_exiting_on_process_exit: process exit event
mark_env_exiting_on_process_exit->>env_teardown_flag: set exiting
JsCodecCallback->>ReplyTsfn: call_with_reply(payload)
ReplyTsfn-->>JsCodecCallback: return queue refusal
Merge Risk:
|
Overview
This PR prevents the Node.js process from aborting when a codec callback is queued during process shutdown.
Details
Where should the reviewer start?
start with
crates/node/src/callable.rsto review the shared callback queue and shutdown handling.then review:
crates/node/src/promise_call.rsfor process-exit detection.crates/node/src/callback_factory.rsfor callback reply handling.crates/node/tests/llm_tests.mjsfor the process-exit regression test.crates/node/tests/callback_error_tests.mjsfor closed-callback behavior.Summary by CodeRabbit