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
GIL not released around getaddrinfo() #38435
Comments
I have a situation where sock.connect() blocks in getaddrinfo(), but |
Logged In: YES This is not a bug. getaddrinfo isn't thread-safe on some |
Logged In: YES Isn't that an orthogonal issue? In that we should then use a lock for I find it unacceptable that my GUI main thread can hang for several seconds Short of that, can we find out on _which_ platforms getaddrinfo() isn't |
Logged In: YES See python.org/sf/604210. Yes, using a separate lock would be possible. At a minimum, As I write in 604210: it would be fine if a separate lock is Would you like to work on a patch? |
Logged In: YES How about simply not releasing the GIL on these platforms? |
Logged In: YES Since my platform is BSD-ish, I want a lock ;-) Yes, I would like to work on a patch, except I will need some hand-holding, |
Logged In: YES (Never mind, I found plenty of examples in sockemodule.c itself.) |
Logged In: YES Mark: the original complaint came from BSD users. So if we You could look at the Tcl lock. I recommend you look at the If your platform is Mac OS X, don't trust that it is too |
Logged In: YES I've attached a first cut of a patch. It implements wrappers for getaddrinfo What needs to be reviewed carefully is when exactly USE_NETDB_LOCK |
Logged In: YES The patch is incorrect: usage of locked getaddrinfo depends I suggest you separate issues:
I think the lock management code is also incorrect: There is I'm not sure how to solve this. It is probably safest to Also, for systems that don't lock getaddrinfo, I would |
Logged In: YES Here's a new attempt. Martin and I went back and forth a few times, and |
Logged In: YES The patch looks fine, and works on Linux for me. Please |
Logged In: YES Thanks! Applied as socketmodule.c rev. 1.265. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: