File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -107,10 +107,16 @@ def target() -> None:
107
107
# Optional: Force container-level kill for true cancellation
108
108
handler = getattr (self , "_handle_timeout" , None )
109
109
if force_kill_on_timeout and callable (handler ):
110
- try :
111
- handler () # pyright: ignore[reportAttributeAccess]
112
- except Exception : # noqa: BLE001
113
- self .logger .warning ("Failed to cleanup container after timeout" )
110
+
111
+ def cleanup_async () -> None :
112
+ try :
113
+ handler () # pyright: ignore[reportAttributeAccess]
114
+ except Exception : # noqa: BLE001
115
+ self .logger .warning ("Failed to cleanup container after timeout" )
116
+
117
+ # Run cleanup in a separate daemon thread to avoid blocking
118
+ cleanup_thread = threading .Thread (target = cleanup_async , daemon = True )
119
+ cleanup_thread .start ()
114
120
115
121
raise SandboxTimeoutError (msg , timeout_duration = timeout )
116
122
You can’t perform that action at this time.
0 commit comments