Commit 7ef3f232 authored by Julien Muchembled's avatar Julien Muchembled

Lower severity of getBootstrapPeer failure when it has no UDP answer

It's normal such failure happens occasionally and re6st retries later so:
- do not frighten user/admin with 500 status and ssl errors
- do not waste resources by killing session with registry
parent c6936c3f
...@@ -102,7 +102,8 @@ class PeerDB(object): ...@@ -102,7 +102,8 @@ class PeerDB(object):
bootpeer = self._registry.getBootstrapPeer(self._prefix) bootpeer = self._registry.getBootstrapPeer(self._prefix)
prefix, address = utils.decrypt(self._key_path, bootpeer).split() prefix, address = utils.decrypt(self._key_path, bootpeer).split()
except (socket.error, subprocess.CalledProcessError, ValueError), e: except (socket.error, subprocess.CalledProcessError, ValueError), e:
logging.warning('Failed to bootstrap (%s)', e) logging.warning('Failed to bootstrap (%s)',
e if bootpeer else 'no peer returned')
else: else:
if prefix != self._prefix: if prefix != self._prefix:
self.addPeer(prefix, address) self.addPeer(prefix, address)
......
...@@ -271,8 +271,8 @@ class RegistryServer(object): ...@@ -271,8 +271,8 @@ class RegistryServer(object):
break break
timeout = max(0, time.time() - start) timeout = max(0, time.time() - start)
else: else:
raise EnvironmentError("Timeout while querying [%s]:%u" logging.info("Timeout while querying [%s]:%u", *address)
% address) return
logging.info("Sending bootstrap peer: %s", msg) logging.info("Sending bootstrap peer: %s", msg)
return utils.encrypt(cert, msg) return utils.encrypt(cert, msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment