mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Catch all exceptions when calling socket.getaddrinfo (#1355)
it serves two purposes: 1. We don't want accidentally break the thread 2. During the shutdown socket.gaierror become unresolvable and nasty exceptions are raised Close: https://github.com/zalando/patroni/issues/1353
This commit is contained in:
+2
-2
@@ -73,8 +73,8 @@ class DnsCachingResolver(Thread):
|
||||
def _do_resolve(host, port):
|
||||
try:
|
||||
return socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM, socket.IPPROTO_TCP)
|
||||
except socket.gaierror:
|
||||
logger.warning('failed to resolve host %s', host)
|
||||
except Exception as e:
|
||||
logger.warning('failed to resolve host %s: %s', host, e)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user