fix: drop duplicate notifySlotAvailable() in SDK child exit handler
CodeRabbit flagged a duplicate slot wakeup: spawnSdkProcess's child 'exit' handler called registry.unregister(recordId) and then notifySlotAvailable() unconditionally. Registry.unregister() already fires notifySlotAvailable() internally when removing an SDK entry, so the trailing call woke a second waiter for the same freed slot — both could see count < maxConcurrent in the same synchronous tick before either replacement registered, transiently exceeding maxConcurrent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -586,7 +586,6 @@ export function spawnSdkProcess(
|
||||
logger.warn('SDK_SPAWN', `[session-${sessionDbId}] Claude process exited`, { code, signal, pid });
|
||||
}
|
||||
registry.unregister(recordId);
|
||||
notifySlotAvailable();
|
||||
});
|
||||
|
||||
if (!child.stdin || !child.stdout || !child.stderr) {
|
||||
|
||||
Reference in New Issue
Block a user