@@ -145,15 +145,7 @@ def _get_queue_intermittently():
145145 if shutdown_event .is_set ():
146146 logger .info (f"Shutdown signal received in future { process_id } " )
147147 raise asyncio .CancelledError ()
148- # return None
149-
150- try :
151- return await asyncio .to_thread (_get_queue_intermittently ) # type: ignore[attr-defined]
152- except asyncio .CancelledError :
153- logger .info ("kaki" )
154- # return None
155- raise
156- # raise
148+ return await asyncio .to_thread (_get_queue_intermittently ) # type: ignore[attr-defined]
157149
158150 async def send_result (
159151 self ,
@@ -305,9 +297,10 @@ async def _wait_for_shutdown(
305297 while not shutdown_event .is_set ():
306298 await asyncio .sleep (shutdown_poll_interval )
307299
308- logger .debug ("Shutdown signal received" )
300+ # Raising asyncio.CancelledError instead would
301+ # cause the asyncio.wait above to wait
302+ # forever, couldn't find a reasonable reason why
309303 raise ShutdownSignalReceived ("Shutdown event set, cancelling process loop." )
310- # raise asyncio.CancelledError("Shutdown event set, cancelling process loop.")
311304
312305 async def _process_synchronous_requests_loop (
313306 self ,
@@ -352,7 +345,6 @@ async def _process_asynchronous_requests_loop(
352345 raise ValueError ("Async worker called with max_concurrency < 1" )
353346
354347 while True :
355- logger .info ("Awaiting request..." )
356348 process_request = await self .get_request (
357349 requests_queue = requests_queue ,
358350 shutdown_event = shutdown_event ,
0 commit comments