Add timeout and logs when enabling msgr2 during upgrade

During audit cycles that run during an upgrade, it is needed to timeout
the enable_msgr2 call. This is a quick operation that takes less than
one second to run. So I added 5 seconds because this should be more than
enough.

I have also added  logs so we can know if anything goes wrong.

Testing performed:

Upgrade 2+2+2:
 Disabled monitor and verified enable_msgr2 took 5 seconds to throw
exception and logged error message

Story: 2009074
Task: 43998

Signed-off-by: Vinicius Lopes da Silva <vinicius.lopesdasilva@windriver.com>
Change-Id: Ifc562188d2dbbbbfc6348155c0d6b6fc85b90a19
This commit is contained in:
Vinicius Lopes da Silva 2021-11-19 18:20:41 -03:00
parent 27f4d85c65
commit 5df3d376be
1 changed files with 10 additions and 1 deletions

View File

@ -5789,7 +5789,16 @@ class ConductorManager(service.PeriodicService):
"latest configuration changes" % mon.hostname)
return
LOG.info("Ceph Upgrade: Enabling monitor msgr2")
self._ceph_api.enable_msgr2()
try:
# This operation takes less than one second to be executed.
# Ten seconds is more than enough to have this executed.
# In case ceph cluster loses quorum, this operation won't hang
# because the request method actually needs to query the ceph cluster
# to retrieve password and service url before running this command.
# Those operations also timeout after 5 seconds.
self._ceph_api.enable_msgr2(timeout=10)
except Exception as e:
LOG.info("Ceph Upgrade: Exception %s" % e)
LOG.info("Ceph Upgrade: Enabled monitor msgr2")
def _audit_install_states(self, hosts):