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):
bootpeer = self._registry.getBootstrapPeer(self._prefix)
prefix, address = utils.decrypt(self._key_path, bootpeer).split()
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:
if prefix != self._prefix:
self.addPeer(prefix, address)
......
......@@ -271,8 +271,8 @@ class RegistryServer(object):
break
timeout = max(0, time.time() - start)
else:
raise EnvironmentError("Timeout while querying [%s]:%u"
% address)
logging.info("Timeout while querying [%s]:%u", *address)
return
logging.info("Sending bootstrap peer: %s", 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