asyncio icon indicating copy to clipboard operation
asyncio copied to clipboard

Cancelled lock waiter wakes up the next one if any

Open msornay opened this issue 9 years ago • 7 comments

Fixes http://bugs.python.org/issue27585

Without the fix the unit test deadlock, I haven't managed to make it fail (using wait_for() seems to avoid the deadlock)

msornay avatar Nov 16 '16 12:11 msornay

@gvanrossum @asvetlov I'm not sure I can review this (I never touched/used that code). Can you take a look if you have time and you are familiar with the code?

1st1 avatar Nov 16 '16 17:11 1st1

Sorry, I can't do it this week or next.

gvanrossum avatar Nov 16 '16 18:11 gvanrossum

Looks like this PR is doing a right thing. @msornay please update the tests, and I will merge it.

1st1 avatar Nov 17 '16 18:11 1st1

Hello, and thanks for your contribution!

Unfortunately we couldn't find an account corresponding to your GitHub username at bugs.python.org (b.p.o). If you don't already have an account at b.p.o, please create one and make sure to add your GitHub username. If you do already have an account at b.p.o then please go there and under "Your Details" add your GitHub username.

And in case you haven't already, please make sure to sign the PSF contributor agreement (CLA); we can't legally look at your contribution until you have signed the CLA.

Once you have done everything that's needed, please reply here and someone will verify everything is in order.

the-knights-who-say-ni avatar Nov 17 '16 23:11 the-knights-who-say-ni

Everything should be in order.

msornay avatar Nov 18 '16 00:11 msornay

After applying patch #363 and #467 to Python 3.5.2, the dead-lock did indeed no longer occur, but the opposite did; Sometimes on releasing the lock, a RuntimeError exception is raised telling me the lock was not acquired.

lock.acquire() try: ... do stuff ... finally: lock.release() # RuntimeError occured here

So far, I did not manage to create a simple test case, and I know this does not help much without it, but should someone experience this same behavior, then just know you are not the only one.

pklanke avatar Jan 09 '17 11:01 pklanke

Please reopen this PR at https://github.com/python/cpython. This repo is going to be deleted soon.

1st1 avatar Mar 02 '17 22:03 1st1