]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: Detect stale and then recreate connections
authorMatthew Oliver <moliver@suse.com>
Thu, 28 May 2020 01:59:19 +0000 (11:59 +1000)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 2 Jun 2020 12:58:27 +0000 (14:58 +0200)
commit11a6787ad004baeab3c6da3a20b9b76cf0a18487
treedc8ab6faf337a9e9ce37e38db98fc93fc6f8059f
parent5557c5f37a9daddbc0561f1664f0508ef875c477
cephadm: Detect stale and then recreate connections

Currently we make and cache connections to nodes during a check_host.
If a cached connection is disconnect from the other end the remoto
connection object doesn't track this, so further checks to the host
fail.

I have pushed up a PR[0] to remoto to add a `has_connection` method to
their `BaseConnection` class, which we now use in this patch to check to
see if the connection is stale. If it is it is then recreated.

There is some monkey patching happening so we can add the required
`has_connection` to remoto in this patch which we can remove as soon as
the other PR have landed and a new version of remoto is released.

[0] https://github.com/alfredodeza/remoto/pull/56
Fixes: https://tracker.ceph.com/issues/45627
Fixes: https://tracker.ceph.com/issues/45032
Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit afabf82395361f5d2209a980578b4b6715d80f3d)
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/tests/test_cephadm.py