Skip to content

Commit

Permalink
librados: only call watch_flush if necessary
Browse files Browse the repository at this point in the history
Fix bug ceph#10424
Signed-off-by: Haomai Wang <[email protected]>
  • Loading branch information
yuyuyu101 committed Dec 23, 2014
1 parent e1384af commit 926a1b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librados/RadosClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ int librados::RadosClient::connect()

void librados::RadosClient::shutdown()
{
// make sure watch callbacks are flushed
watch_flush();

lock.Lock();
if (state == DISCONNECTED) {
lock.Unlock();
Expand All @@ -301,8 +298,11 @@ void librados::RadosClient::shutdown()
instance_id = 0;
timer.shutdown(); // will drop+retake lock
lock.Unlock();
if (need_objecter)
if (need_objecter) {
// make sure watch callbacks are flushed
watch_flush();
objecter->shutdown();
}
monclient.shutdown();
if (messenger) {
messenger->shutdown();
Expand Down

0 comments on commit 926a1b7

Please sign in to comment.