File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -314,9 +314,15 @@ def _shutdown_workers(self):
314314 if not self .shutdown :
315315 self .shutdown = True
316316 self .done_event .set ()
317- # if worker_manager_thread is waiting to put
318- while not self .data_queue .empty ():
319- self .data_queue .get ()
317+ # if worker_manager_thread is waiting to put, make place for it
318+ try :
319+ while not self .data_queue .empty ():
320+ self .data_queue .get ()
321+ except FileNotFoundError :
322+ # FileNotFoundError can happen when we rebuild the fd
323+ # fetched from the queue but the socket is already closed
324+ # from the worker side (e.g. due to Python shutting down).
325+ pass
320326 for _ in self .workers :
321327 self .index_queue .put (None )
322328 # done_event should be sufficient to exit worker_manager_thread,
You can’t perform that action at this time.
0 commit comments