-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove process-id checks from asyncio. Asyncio and fork() does not mix. #2911
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
Remove process-id checks from asyncio. Asyncio and fork() does not mix. #2911
Conversation
f81e6c4 to
b3e7893
Compare
Codecov ReportPatch coverage:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2911 +/- ##
===========================================
- Coverage 91.28% 66.75% -24.53%
===========================================
Files 126 126
Lines 32398 32331 -67
===========================================
- Hits 29573 21584 -7989
- Misses 2825 10747 +7922
☔ View full report in Codecov by Sentry. |
d169b49 to
6793fb3
Compare
6793fb3 to
ab34b5d
Compare
ab34b5d to
cb2bc57
Compare
cb2bc57 to
004e15e
Compare
|
@kristjanvalur Just checking in - is this one something you wanted reviewed? @dvora-h see the test failures. I'm surprised that some of these (cluster) ran. |
|
This is not reproducible here with individual steps. I'll figure it out and let you know when I think I have something which needs can be reviewed |
b9576f5 to
d78b85e
Compare
|
@chayim Found the issue. Some mocks were not being undone properly which played havoc with the cleanup. Last two commits are test fixes can be applied to main independently, I can create a separate PR for that if you like. |
Pull Request check-list
$ toxpass with this change (including linting)?Description of change
Remove
PIDchecks fromasyncioconnections, sinceasyncioandfork()does not mix. See issue #2910Details:
Python does not support
fork()on a process with a runningasyncioevent loop. Therefore supporting a connection pool of connection from a different process is not necessary.Similarly, connection pools don't need to deal with different threads either.
We remove the checks for process ids, intended to ignore inherited file descriptors (even though these should probably have been closed on fork anyway).
We remove lenience when returning a connection to a pool, it should always be returned to the pool it originated from. Not doing that would be a resource leak.
We simplify
BlockingConnectionPoolsince it does not need to do any multi-threading. It now just adds a simple wait mechanism on top of theConnectionPool, reducing code and overhead. TheQueueClassargument is now ignored. It always was a weird implementation leak anyway