fix(exec): retain stale sessions after cleanup failure

Only remove idle exec sessions after process termination succeeds so later cleanup and shutdown paths can retry failed kills.
This commit is contained in:
KDB
2026-07-23 23:55:00 +08:00
committed by chengyongru
parent 274613f064
commit 648fc92673
2 changed files with 26 additions and 1 deletions
+2 -1
View File
@@ -370,8 +370,9 @@ class ExecSessionManager:
if now - session.last_access > self.idle_timeout
]
for session_id in stale:
session = self._sessions.pop(session_id)
session = self._sessions[session_id]
await session.kill()
self._sessions.pop(session_id, None)
async def _spawn(
self,