Skip to content

Commit

Permalink
pythongh-91305: Add a note about DatagramHandler and DNS latency. (py…
Browse files Browse the repository at this point in the history
…thonGH-96380)

(cherry picked from commit 6324b13)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
  • Loading branch information
vsajip authored and miss-islington committed Aug 29, 2022
1 parent 882c7cf commit 11d4905
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 11d4905

Please sign in to comment.