]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: system.get_mounts() refactor 47535/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Aug 2022 06:27:30 +0000 (08:27 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Aug 2022 12:49:20 +0000 (14:49 +0200)
commit94df47160a4292b2a554b7db9e27180cbf11b944
treebd36b1ce7800bf997359493412a248932c92bb8c
parent77b071d5daed7907775d1c8f59a1ebfadc12d05f
ceph-volume: system.get_mounts() refactor

When a network mount is present in `/proc/mounts` but for any reason
the corresponding server is down, this function hangs forever.
In a cluster deployed with cephadm, the consequence is that
it triggers `ceph-volume inventory` commands that hang and stay in D
state.

The idea here is to use a thread with a timeout to abort the call if the
timeout is reached.
`get_mounts()` is now a method of a class so we can exclude a path
altogether during the whole `inventory` execution (otherwise,
ceph-volume would try to access it as many devices there is on the
host which could slow down the inventory execution)

Fixes: https://tracker.ceph.com/issues/57070
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 89cad1f33b30bf9237734ee3595eb000facfc7d8)
src/ceph-volume/ceph_volume/devices/simple/scan.py
src/ceph-volume/ceph_volume/tests/util/test_system.py
src/ceph-volume/ceph_volume/util/encryption.py
src/ceph-volume/ceph_volume/util/system.py