Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6324b13

Browse files
authored
gh-91305: Add a note about DatagramHandler and DNS latency. (GH-96380)
1 parent e5b2453 commit 6324b13

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/logging.handlers.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,13 @@ over UDP sockets.
572572
Returns a new instance of the :class:`DatagramHandler` class intended to
573573
communicate with a remote machine whose address is given by *host* and *port*.
574574

575+
.. note:: As UDP is not a streaming protocol, there is no persistent connection
576+
between an instance of this handler and *host*. For this reason, when using a
577+
network socket, a DNS lookup might have to be made each time an event is
578+
logged, which can introduce some latency into the system. If this affects you,
579+
you can do a lookup yourself and initialize this handler using the looked-up IP
580+
address rather than the hostname.
581+
575582
.. versionchanged:: 3.4
576583
If ``port`` is specified as ``None``, a Unix domain socket is created
577584
using the value in ``host`` - otherwise, a UDP socket is created.

0 commit comments

Comments
 (0)