Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Condition class #25526

Closed
wants to merge 1 commit into from
Closed

Update Condition class #25526

wants to merge 1 commit into from

Conversation

mtasic85
Copy link

@mtasic85 mtasic85 commented Apr 22, 2021

The loop parameter will be removed in version 3.10. As far as I can see, loop parameter is still present in source code, but it is initialized to special value mixin._marker. It is still in source code probably for backward compatibility reasons. If this is true, we should be able to check if lock._loop is not None, and then check if it matches with self._loop().

I run into this issue with 3rd party library aetcd3 which does not explicitly check loop of its asyncio.Lock/Condition instances, but asyncio.locks.Condition does not correctly check for this condition. After monkey-patching asyncio.Condition, everything works as expected.

The `loop` parameter will be removed in version 3.10. As far as I can see, `loop` parameter is still present in source code, but it is initialized to special value `mixin._marker`. It is still in source code probably for backward compatibility reasons. If this is true, we should be able to check if `lock._loop is not None`, and then check if it matches with `self._loop()`.

I run into this issue with 3rd party library `aetcd3` which does not explicitly check loop of its `asyncio.Lock/Condition` instances, but `asyncio.locks.Condition` does not correctly check for this condition. After monkey-patching `asyncio.Condition`, everything works as expected.
@mtasic85 mtasic85 requested review from 1st1 and asvetlov as code owners Apr 22, 2021
@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Apr 22, 2021

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@mtasic85

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 3, 2021
@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Feb 26, 2022

@asvetlov This can be closed as #31431 is merged.

@asvetlov
Copy link
Contributor

asvetlov commented Mar 12, 2022

Sure, thanks!

@asvetlov asvetlov closed this Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants