Possible deadlock race condition between image close and librados shutdown
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