]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 30 Aug 2022 08:58:14 +0000 (01:58 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Aug 2022 08:58:14 +0000 (09:58 +0100)
Doc/library/logging.handlers.rst

index f125dfe64a03e89c50182bc89b0acd68ec8401b9..a0129279f4db4450de2409159df18f6ee3a21fae 100644 (file)
@@ -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.