File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,9 +102,11 @@ def close(self) -> None:
102102 any in-flight playback_snapshot() fan-out to finish so worker threads
103103 are not orphaned and can't raise at interpreter shutdown (issue #89).
104104 """
105- # Stop accepting new submissions first. cancel_futures=True (3.9+)
106- # drops not-yet-started tasks; started ones still run to completion.
107- self ._executor .shutdown (wait = False , cancel_futures = True )
105+ # Stop accepting new submissions. Do NOT use cancel_futures=True here:
106+ # playback_snapshot() is actively awaiting future.result() on the same
107+ # futures, and cancelling them would raise CancelledError inside the
108+ # snapshot call. The drain loop below handles waiting.
109+ self ._executor .shutdown (wait = False )
108110 with self ._pending_lock :
109111 pending = list (self ._pending_futures )
110112 # Drain in-flight tasks with a short bounded timeout per future. If a
You can’t perform that action at this time.
0 commit comments