Repository navigation
fix(gateway): use already-aborted signal in stopChannel fallback - #62722
pruthvishetty wants to merge 1 commit into
Conversation
…oller exists When stopChannel is called for an account without an active AbortController, the fallback `new AbortController().signal` creates a signal from an anonymous, unreferenced controller that can never be aborted. If stopAccount implementations use the signal for cleanup coordination, the never-aborting signal can cause hangs during graceful shutdown. Replace with `AbortSignal.abort()` which returns an already-aborted signal, correctly communicating that the account is being stopped.
Greptile SummaryReplaces Confidence Score: 5/5Safe to merge — a correct one-line fix with no side effects. Minimal, well-justified change that fixes a real behavioral inconsistency. AbortSignal.abort() is available in Node 15.12+ and the project requires Node 22+. No P0/P1 issues found. No files require special attention. Reviews (1): Last reviewed commit: "fix(gateway): use already-aborted signal..." | Re-trigger Greptile |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close as stalled and unproven: the patch proposes a plausible gateway lifecycle correction, but the external branch has been idle since April 7, 2026, is currently dirty against So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: If the no-controller stop path is still needed, submit a fresh, rebased PR with focused tests for both controller-present and controller-absent calls plus redacted after-fix gateway shutdown evidence. Do we have a high-confidence way to reproduce the issue? Yes, from source: create a channel account with no active controller, invoke Is this the best way to solve the issue? Unclear: an already-aborted fallback is a plausible symmetry fix, but a plugin stop handler may rely on a usable signal for cleanup, so a focused contract test and real shutdown proof are needed before accepting it as the best fix. Security review: Security review cleared: The one-line runtime-signal change adds no dependency, secret, permission, supply-chain, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against e04ea7916c5b. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
stopChannel, when noAbortControllerexists for an account (i.e. no running task), the fallbacknew AbortController().signalcreates a signal from an anonymous controller that can never be abortedstopAccountimplementations may use this signal for cleanup coordination (checkingsignal.aborted, passing tofetch, using withsleepWithAbort, etc.)stopAccountto hang or timeout during graceful shutdown instead of completing immediatelyFix
Replace
new AbortController().signalwithAbortSignal.abort(), which returns an already-aborted signal. This correctly communicates "this account is being stopped" to the plugin'sstopAccountimplementation.Context
On line 485,
abort?.abort()is called — so ifabortexists, its signal is already aborted. The fallback only fires whenabortis undefined (no active task for this account). In both cases the intent is the same: tellstopAccountto shut down.AbortSignal.abort()makes the fallback consistent with the primary path.Test plan
server-channels.test.tspassAbortSignal.abort()is available since Node 15.12.0; project requires Node 22+[AI-assisted]
🤖 Generated with Claude Code