]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix 'stop' command
authorSage Weil <sage.weil@dreamhost.com>
Mon, 21 Nov 2011 21:28:36 +0000 (13:28 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 21 Nov 2011 21:28:36 +0000 (13:28 -0800)
Special case.  We can't join the command_tp thread from itself.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/OSD.cc

index aeba6b8a51378565df97b65aceeed04131d27ff5..8670ebb55b6b28c0ea068ab05e883d4952da6fa0 100644 (file)
@@ -2240,6 +2240,14 @@ void OSD::handle_command(MMonCommand *m)
 {
   if (!require_mon_peer(m))
     return;
+
+  // special case shutdown, since shutdown() stops the command_tp
+  if (m->cmd[0] == "stop") {
+    shutdown();
+    m->put();
+    return;
+  }
+
   Command *c = new Command(m->cmd, m->get_tid(), m->get_data(), NULL);
   command_wq.queue(c);
   m->put();
@@ -2264,6 +2272,13 @@ void OSD::handle_command(MCommand *m)
     return;
   }
 
+  // special case shutdown, since shutdown() stops the command_tp
+  if (m->cmd[0] == "stop") {
+    shutdown();
+    m->put();
+    return;
+  }
+
   Command *c = new Command(m->cmd, m->get_tid(), m->get_data(), con);
   command_wq.queue(c);