Skip to content

Commit

Permalink
Fix: Stopping executions could be returned
Browse files Browse the repository at this point in the history
Solution: Reuse `pool.get_running_vm` that checks if the execution is being stopped.
  • Loading branch information
hoh committed Mar 5, 2024
1 parent 010c0d7 commit c1c438c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/aleph/vm/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ async def create_a_vm(

# Check if an execution is already present for this VM, then return it.
# Do not `await` in this section.
try:
return self.executions[vm_hash]
except KeyError:
current_execution = self.get_running_vm(vm_hash)

Check warning on line 92 in src/aleph/vm/pool.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/pool.py#L92

Added line #L92 was not covered by tests
if current_execution:
return current_execution

Check warning on line 94 in src/aleph/vm/pool.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/pool.py#L94

Added line #L94 was not covered by tests
else:
execution = VmExecution(
vm_hash=vm_hash,
message=message,
Expand Down

0 comments on commit c1c438c

Please sign in to comment.