]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrClient: do not assert on control-c
authorSage Weil <sage@redhat.com>
Tue, 14 Mar 2017 14:02:38 +0000 (10:02 -0400)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 15:39:26 +0000 (11:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/CommandTable.h
src/mgr/MgrClient.cc

index 6aab1b8c24b1ba37f203776ff3c32c1d2316d11c..e952ebe2f27895ebef745056b44a1056e4d89f9f 100644 (file)
@@ -93,6 +93,10 @@ public:
   {
     commands.erase(tid);
   }
+
+  void clear() {
+    commands.clear();
+  }
 };
 
 #endif
index cb5a39ade64bd97bff935a0a16a7999314f4ea77..1defc2c9f0a3aae8a47862147a360aebb3a34261 100644 (file)
@@ -49,6 +49,10 @@ void MgrClient::shutdown()
 {
   Mutex::Locker l(lock);
 
+  // forget about in-flight commands if we are prematurely shut down
+  // (e.g., by control-C)
+  command_table.clear();
+
   timer.shutdown();
   session.reset();
 }