Sorin Sbarnea <sorin.sbar...@gmail.com> added the comment:

I am able to reproduce this bug with Python 3.10 on MacOS 12.2 too, and I 
happen to have some extra insights about what happens, see 
https://github.com/tox-dev/tox/issues/2375

Basically the culprit is a reverse-dns query (PTR) that takes 30s to return, 
causing that very long delay. It appears that mDNSResponder is able to cache 
the result for some time but not very long, so it will happen again.

In my particular case that PTR query is an .ip6.arpa one and there is no ipv4 
query made at all.

I was not able to identify any similar delay while calling `scutil --get 
HostName` or `hostname`, but `socket.getfqdn()` does reproduce it reliably.

Interestingly, it seems that the delay is at least sometimes 15s, maybe the 
delay of 30s I observed on tox was caused by two calls.

Anyway, I am more than interested in finding a solution for this issue. Such a 
delays can be a real dealbreaker even for cli tools.

----------
versions: +Python 3.10, Python 3.8, Python 3.9

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

Reply via email to