Skip to content

Commit a150a2d

Browse files
committed
Fix: An IndexError was raised if no execution was left for this sender.
Solution: Catch and handle the IndexError.
1 parent 5bf3b5d commit a150a2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/aleph/vm/orchestrator/tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ async def monitor_payments(app: web.Application):
174174
logger.debug(f"Required stream for Sender {sender} executions: {required_stream}")
175175
# Stop executions until the required stream is reached
176176
while stream < (required_stream + settings.PAYMENT_BUFFER):
177-
last_execution = executions.pop(-1)
177+
try:
178+
last_execution = executions.pop(-1)
179+
except IndexError: # Empty list
180+
logger.debug("No execution can be maintained due to insufficient stream")
181+
break
178182
logger.debug(f"Stopping {last_execution} due to insufficient stream")
179183
await pool.stop_vm(last_execution.vm_hash)
180184
required_stream = await compute_required_flow(executions)

0 commit comments

Comments
 (0)