[Python-checkins] [3.11] gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380) (GH-96401)

vsajip webhook-mailer at python.org
Tue Aug 30 04:58:43 EDT 2022


https://github.com/python/cpython/commit/8e2d347183df4b4fcd2f3bd963bd7575c6db663b
commit: 8e2d347183df4b4fcd2f3bd963bd7575c6db663b
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: vsajip <vinay_sajip at yahoo.co.uk>
date: 2022-08-30T09:58:37+01:00
summary:

[3.11] gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380) (GH-96401)

files:
M Doc/library/logging.handlers.rst

diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 1e61a519bc0..c4f501faca6 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -572,6 +572,13 @@ over UDP sockets.
    Returns a new instance of the :class:`DatagramHandler` class intended to
    communicate with a remote machine whose address is given by *host* and *port*.
 
+   .. note:: As UDP is not a streaming protocol, there is no persistent connection
+      between an instance of this handler and *host*. For this reason, when using a
+      network socket, a DNS lookup might have to be made each time an event is
+      logged, which can introduce some latency into the system. If this affects you,
+      you can do a lookup yourself and initialize this handler using the looked-up IP
+      address rather than the hostname.
+
    .. versionchanged:: 3.4
       If ``port`` is specified as ``None``, a Unix domain socket is created
       using the value in ``host`` - otherwise, a UDP socket is created.



More information about the Python-checkins mailing list