Author anacrolix
Recipients anacrolix, bquinlan, loewis, pitrou, rosslagerwall
Date 2012-03-31.09:34:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333186492.91.0.575953383854.issue14406@psf.upfronthosting.co.za>
In-reply-to
Content
Patch with a test included. Being a nondeterministic bug, please adjust the thread count, or timing as necessary, the parameters in the patch are as low as I can get them and still reasonably reproduce the bug (linux 3.2, i386).

There's a few complications in testing this. Firstly timeouts cannot be used, because at the end of the timeout, all the futures are checked to categorize them into done and not done. Except for taking the entire duration of the timeout given to return, the bug is masked in this case.

Secondly, it can't be known how long a wait *should* take, so failing after some duration and assuming a stall due to the race decrementing num_pending_calls would be a guess dependent on the capabilities of the system.

If a timeout needs to be added (and fired from an outside thread for reasons given above), please let me know, and direct me to an example of this kind of testing elsewhere in the stdlib, so I can do this idiomatically.

Without applying the patch, the test case provided will (usually) hang indefinitely.
History
Date User Action Args
2012-03-31 09:34:53anacrolixsetrecipients: + anacrolix, loewis, bquinlan, pitrou, rosslagerwall
2012-03-31 09:34:52anacrolixsetmessageid: <1333186492.91.0.575953383854.issue14406@psf.upfronthosting.co.za>
2012-03-31 09:34:52anacrolixlinkissue14406 messages
2012-03-31 09:34:52anacrolixcreate