File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -315,10 +315,11 @@ def close(self) -> None:
315315 if self .connected :
316316 self .conn .close ()
317317 # Technically we don't need to wait, but otherwise we will get ResourceWarnings.
318+ # Also, it is generally good to not leave some running worker processes behind.
318319 try :
319320 self .proc .wait (timeout = WORKER_SHUTDOWN_TIMEOUT )
320321 except subprocess .TimeoutExpired :
321- pass
322+ self . proc . terminate ()
322323 if os .path .isfile (self .status_file ):
323324 os .unlink (self .status_file )
324325
Original file line number Diff line number Diff line change 5151# with our generous timeouts, so we set them higher.
5252WORKER_START_INTERVAL : Final = 0.01 if sys .platform != "win32" else 0.03
5353WORKER_START_TIMEOUT : Final = 3 if sys .platform != "win32" else 10
54- WORKER_SHUTDOWN_TIMEOUT : Final = 1 if sys .platform != "win32" else 3
54+ WORKER_SHUTDOWN_TIMEOUT : Final = 3 if sys .platform != "win32" else 10
5555
5656WORKER_CONNECTION_TIMEOUT : Final = 10
5757WORKER_IDLE_TIMEOUT : Final = 600
You can’t perform that action at this time.
0 commit comments