Bruce Merry <bme...@gmail.com> added the comment:

> Hmm. I'm not sure we should try to work around a bad resolver issue. What's 
> your platform, and how did you install Python?

Fair point. It's Ubuntu 20.04, running inside Docker, with the default Python 
(3.8). I've also reproduced it outside Docker (again Ubuntu 20.04 with system 
Python). The TTL is 30s, so I'm not sure why systemd-resolved isn't caching it 
for messages logged several times a second.

Even if the system has a local cache though, it's not ideal to have logging 
block when the TTL expires, particularly in an event-driven (asyncio) service. 
Updating the address in a background thread while continuing to log to the old 
address might be better. But my use case is particularly real-time (even 10ms 
of latency is problematic), and maybe that shouldn't drive the default 
behaviour.

I blame the lack of standard POSIX functions for doing DNS lookups 
asynchronously and in a way that provides TTL information to the client.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47149>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to