[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-30 Thread Bruce Merry
Bruce Merry added the comment: > But it's going to be non-trivial, I fear. Yeah. Maybe some documentation is achievable in the short term though, so that users who care more about latency than changing DNS are aware that they should do the lookup themselves? --

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith
Eric V. Smith added the comment: > I blame the lack of standard POSIX functions for doing DNS lookups > asynchronously and in a way that provides TTL information to the client. I totally agree with that! And I agree it would be nice to have some way of doing non-blocking lookups when the

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry
Bruce Merry 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

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith
Eric V. Smith 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? -- ___ Python tracker

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry
Bruce Merry added the comment: > Yes, that's what I mean. Isn't the resolver library smart enough to cache > lookups and handle the TTL timeout by itself? Apparently not in this case - with tcpdump I can see the DNS requests being fired off several times a second. I'll need to check what

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith
Eric V. Smith added the comment: > Do you mean expiring the IP address when the TTL is reached? Yes, that's what I mean. Isn't the resolver library smart enough to cache lookups and handle the TTL timeout by itself? -- ___ Python tracker

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry
Bruce Merry added the comment: > If you don’t look it up every time, how do you deal with DNS timeouts? Do you mean expiring the IP address when the TTL is reached? I suppose that could be an issue for a long-running service, and I don't have a good answer to that. Possibly these days with

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Eric V. Smith
Eric V. Smith added the comment: If you don’t look it up every time, how do you deal with DNS timeouts? -- nosy: +eric.smith ___ Python tracker ___

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry
Change by Bruce Merry : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-29 Thread Bruce Merry
New submission from Bruce Merry : logging.DatagramHandler uses socket.sendto to send the messages. If the given address is a hostname rather than an IP address, it will do a DNS lookup every time. I suspect that fixing issue 14855 will also fix this, since fixing that issue requires