@@ -250,73 +250,6 @@ def test_crash_big_data(self):
250
250
251
251
executor .shutdown (wait = True )
252
252
253
- def test_gh105829_should_not_deadlock_if_wakeup_pipe_full (self ):
254
- # Issue #105829: The _ExecutorManagerThread wakeup pipe could
255
- # fill up and block. See: https://github.com/python/cpython/issues/105829
256
-
257
- # Lots of cargo culting while writing this test, apologies if
258
- # something is really stupid...
259
-
260
- self .executor .shutdown (wait = True )
261
-
262
- if not hasattr (signal , 'alarm' ):
263
- raise unittest .SkipTest (
264
- "Tested platform does not support the alarm signal" )
265
-
266
- def timeout (_signum , _frame ):
267
- import faulthandler
268
- faulthandler .dump_traceback ()
269
-
270
- raise RuntimeError ("timed out while submitting jobs?" )
271
-
272
- thread_run = futures .process ._ExecutorManagerThread .run
273
- def mock_run (self ):
274
- # Delay thread startup so the wakeup pipe can fill up and block
275
- time .sleep (3 )
276
- thread_run (self )
277
-
278
- class MockWakeup (_ThreadWakeup ):
279
- """Mock wakeup object to force the wakeup to block"""
280
- def __init__ (self ):
281
- super ().__init__ ()
282
- self ._dummy_queue = queue .Queue (maxsize = 1 )
283
-
284
- def wakeup (self ):
285
- self ._dummy_queue .put (None , block = True )
286
- super ().wakeup ()
287
-
288
- def clear (self ):
289
- try :
290
- while True :
291
- self ._dummy_queue .get_nowait ()
292
- except queue .Empty :
293
- super ().clear ()
294
-
295
- with (unittest .mock .patch .object (futures .process ._ExecutorManagerThread ,
296
- 'run' , mock_run ),
297
- unittest .mock .patch ('concurrent.futures.process._ThreadWakeup' ,
298
- MockWakeup )):
299
- with self .executor_type (max_workers = 2 ,
300
- mp_context = self .get_context ()) as executor :
301
- self .executor = executor # Allow clean up in fail_on_deadlock
302
-
303
- job_num = 100
304
- job_data = range (job_num )
305
-
306
- # Need to use sigalarm for timeout detection because
307
- # Executor.submit is not guarded by any timeout (both
308
- # self._work_ids.put(self._queue_count) and
309
- # self._executor_manager_thread_wakeup.wakeup() might
310
- # timeout, maybe more?). In this specific case it was
311
- # the wakeup call that deadlocked on a blocking pipe.
312
- old_handler = signal .signal (signal .SIGALRM , timeout )
313
- try :
314
- signal .alarm (int (self .TIMEOUT ))
315
- self .assertEqual (job_num , len (list (executor .map (int , job_data ))))
316
- finally :
317
- signal .alarm (0 )
318
- signal .signal (signal .SIGALRM , old_handler )
319
-
320
253
321
254
create_executor_tests (globals (), ExecutorDeadlockTest ,
322
255
executor_mixins = (ProcessPoolForkMixin ,
0 commit comments