Skip to content

Commit

Permalink
delete kernel from kernel_registry when its cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed May 29, 2024
1 parent fc1a8e4 commit 09893dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ai/backend/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,10 @@ async def _handle_clean_event(self, ev: ContainerLifecycleEvent) -> None:
await kernel_obj.close()
finally:
self.terminating_kernels.discard(ev.kernel_id)
try:
del self.kernel_registry[ev.kernel_id]
except KeyError:
pass
if restart_tracker := self.restarting_kernels.get(ev.kernel_id, None):
restart_tracker.destroy_event.set()
else:
Expand Down

0 comments on commit 09893dc

Please sign in to comment.