Skip to content

Commit db23c0c

Browse files
Pruthvi ShettyPruthvi Shetty
authored andcommitted
fix(gateway): use already-aborted signal in stopChannel when no controller 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.
1 parent 4108901 commit db23c0c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/gateway/server-channels.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage
490490
accountId: id,
491491
account,
492492
runtime: channelRuntimeEnvs[channelId],
493-
abortSignal: abort?.signal ?? new AbortController().signal,
493+
abortSignal: abort?.signal ?? AbortSignal.abort(),
494494
log: channelLogs[channelId],
495495
getStatus: () => getRuntime(channelId, id),
496496
setStatus: (next) => setRuntime(channelId, id, next),

0 commit comments

Comments
 (0)