summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-11-21 13:28:36 -0800
committerSage Weil <sage.weil@dreamhost.com>2011-11-21 13:28:36 -0800
commit3c8fec2d336917a9a016edd0a20c1a411270cb08 (patch)
tree338e96c828358b3a61d837fd78b9c6d1b8e7e274
parentb47347bd7c377037f7fbc199f0c88b447c9626d1 (diff)
downloadceph-3c8fec2d336917a9a016edd0a20c1a411270cb08.tar.gz
osd: fix 'stop' command
Special case. We can't join the command_tp thread from itself. Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
-rw-r--r--src/osd/OSD.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index aeba6b8a513..8670ebb55b6 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -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);