Log node info when failing to sync static node

In case host is offline nodepool throws an exception without mentioning
hostname:

  ERROR nodepool.driver.static.StaticNodeProvider: Couldn't sync node:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.7/site-packages/nodepool/driver/static/provider.py", line 427, in cleanupLeakedResources
      self.syncNodeCount(registered, node, pool)
    File "/usr/local/lib/python3.7/site-packages/nodepool/driver/static/provider.py", line 320, in syncNodeCount
      register_cnt, self.provider.name, pool, node)
    File "/usr/local/lib/python3.7/site-packages/nodepool/driver/static/provider.py", line 210, in registerNodeFromConfig
      nodeutils.set_node_ip(node)
    File "/usr/local/lib/python3.7/site-packages/nodepool/nodeutils.py", line 48, in set_node_ip
      addrinfo = socket.getaddrinfo(node.hostname, node.connection_port)[0]
    File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
      for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  socket.gaierror: [Errno -2] Name or service not known

Change-Id: I8d9a5b382c4905ce14022f6d6f02f6d323799700
This commit is contained in:
Vitaliy Lotorev 2022-03-13 23:18:28 +03:00
parent a2e5e640ad
commit 6520ae56b6
1 changed files with 2 additions and 1 deletions

View File

@ -399,7 +399,8 @@ class StaticNodeProvider(Provider, QuotaSupport):
self.log.warning("Couldn't sync node: %s", exc)
continue
except Exception:
self.log.exception("Couldn't sync node:")
self.log.exception("Couldn't sync node %s:",
nodeTuple(node))
continue
def getRequestHandler(self, poolworker, request):