Skip to content

Commit d05b116

Browse files
committed
mds: add lockup debugging command
To artificially make the rank unresponsive for a time. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent ca414b0 commit d05b116

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/mds/MDSDaemon.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ void MDSDaemon::asok_command(
149149
if (command == "status") {
150150
dump_status(f);
151151
r = 0;
152+
} else if (command == "lockup") {
153+
int64_t millisecs;
154+
cmd_getval(cmdmap, "millisecs", millisecs);
155+
derr << "(lockup) sleeping with mds_lock for " << millisecs << dendl;
156+
std::lock_guard l(mds_lock);
157+
std::this_thread::sleep_for(std::chrono::milliseconds(millisecs));
158+
r = 0;
152159
} else if (command == "exit") {
153160
outbl.append("Exiting...\n");
154161
r = 0;
@@ -256,6 +263,11 @@ void MDSDaemon::set_up_admin_socket()
256263
r = admin_socket->register_command("status", asok_hook,
257264
"high-level status of MDS");
258265
ceph_assert(r == 0);
266+
r = admin_socket->register_command("lockup "
267+
"name=millisecs,type=CephInt,req=true,range=0"
268+
, asok_hook
269+
, "sleep with mds_lock held (dev)");
270+
ceph_assert(r == 0);
259271
r = admin_socket->register_command("dump_ops_in_flight", asok_hook,
260272
"show the ops currently in flight");
261273
ceph_assert(r == 0);

0 commit comments

Comments
 (0)