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

GH-104308: socket.getnameinfo should release the GIL (GH-104307)

* socket.getnameinfo should release the GIL

* 📜🤖 Added by blurb_it.

---------

(cherry picked from commit faf196213e)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-05-08 16:49:45 -07:00 committed by GitHub
parent 2ee250383f
commit b7622e7a05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1 @@
:func:`socket.getnameinfo` now releases the GIL while contacting the DNS server

View file

@ -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;