From 6e4d9735036a68575696e53b6732e4680a0226d6 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 24 Oct 2017 14:45:12 -0400 Subject: [PATCH] rgw: BucketTrimWatcher checks handle in stop Signed-off-by: Casey Bodley --- src/rgw/rgw_sync_log_trim.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index 80d8f2205f7..1314f7bf1a4 100644 --- a/src/rgw/rgw_sync_log_trim.cc +++ b/src/rgw/rgw_sync_log_trim.cc @@ -295,8 +295,10 @@ class BucketTrimWatcher : public librados::WatchCtx2 { void stop() { - ref.ioctx.unwatch2(handle); - ref.ioctx.close(); + if (handle) { + ref.ioctx.unwatch2(handle); + ref.ioctx.close(); + } } /// respond to bucket trim notifications -- 2.39.5