Backport #17265
Updated by Xiaoxi Chen over 7 years ago
https://github.com/ceph/ceph/pull/11056 librbd::ImageWatcher::C_UnwatchAndFlush instantiates a librados::Rados class to invoke aio_watch_flush. However, it's possible that the destruction of this librados::Rados instance could race with an explicit librados::Rados::shutdown request of the same connection. This results in a deadlock as librados::Rados::shutdown holds the lock but waits for the finisher to flush the watches -- but the finisher is now deadlocked trying to acquire the librados::Rados lock. See ticket #17252