librados: watch_flush() on shutdown

Users can easily forget this. It makes shutdown potentially block, but if
they have racing callbacks they get what they ask for.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 30678f6daf)
This commit is contained in:
Sage Weil 2014-12-19 11:50:38 -08:00
parent 7de1b4d4ff
commit 93825bf05a

View File

@ -282,6 +282,9 @@ int librados::RadosClient::connect()
void librados::RadosClient::shutdown()
{
// make sure watch callbacks are flushed
watch_flush();
lock.Lock();
if (state == DISCONNECTED) {
lock.Unlock();