]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: system.get_mounts() refactor 47514/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Aug 2022 06:27:30 +0000 (08:27 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Aug 2022 09:44:15 +0000 (11:44 +0200)
commit89cad1f33b30bf9237734ee3595eb000facfc7d8
treeb771bc5a73a0ccf3b150c69d135eb4eca5b50cb1
parent9a498550d127f6e335c7de6b7c0c7552e9190d1a
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>
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