Skip to content

Commit

Permalink
Add sleep 0 for scheling cleanup tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Heyi Tang committed May 11, 2024
1 parent d72417d commit 3235f9d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ async def _wait_and_complete_nodes(
for task in tasks:
if not task.done():
task.cancel()
# Wait for the cancelled tasks to be scheduled to cleanup
await asyncio.sleep(0)
err_msg = f"Line execution timeout after {line_timeout_sec} seconds."
context.cancel_node_runs(err_msg)
raise LineExecutionTimeoutError(context._line_number, line_timeout_sec)
Expand Down

0 comments on commit 3235f9d

Please sign in to comment.