Skip to content

Commit

Permalink
Fix: forget_vm called twice when VM init times out
Browse files Browse the repository at this point in the history
Solution: Allow execution to be already missing.
  • Loading branch information
hoh committed Feb 16, 2022
1 parent 4441867 commit 8659a8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vm_supervisor/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ async def get_running_vm(self, vm_hash: VmHash) -> Optional[VmExecution]:
return None

def forget_vm(self, vm_hash: VmHash) -> None:
self.executions.pop(vm_hash)
try:
del self.executions[vm_hash]
except KeyError:
pass

async def stop(self):
"""Stop all VMs in the pool."""
Expand Down

0 comments on commit 8659a8a

Please sign in to comment.