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

[3.11] GH-104308: socket.getnameinfo should release the GIL (GH-104307) #104313

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:func:`socket.getnameinfo` now releases the GIL while contacting the DNS server
2 changes: 2 additions & 0 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6737,8 +6737,10 @@ socket_getnameinfo(PyObject *self, PyObject *args)
}
#endif
}
Py_BEGIN_ALLOW_THREADS
error = getnameinfo(res->ai_addr, (socklen_t) res->ai_addrlen,
hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), flags);
Py_END_ALLOW_THREADS
if (error) {
set_gaierror(error);
goto fail;
Expand Down