]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: dump remaining coroutines when cr deadlock is detected 11580/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 19 Oct 2016 17:01:39 +0000 (13:01 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 20 Oct 2016 15:21:28 +0000 (11:21 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_coroutine.cc

index 7cebd27e5587d8562f861306d635a329d79462a0..8f97eac3e78835b85c80b7d3b756d83e364b3ab5 100644 (file)
@@ -588,7 +588,19 @@ int RGWCoroutinesManager::run(list<RGWCoroutinesStack *>& stacks)
   }
 
   lock.get_write();
-  assert(context_stacks.empty() || going_down.read()); // assert on deadlock
+  if (!context_stacks.empty() && !going_down.read()) {
+    JSONFormatter formatter(true);
+    formatter.open_array_section("context_stacks");
+    for (auto& s : context_stacks) {
+      ::encode_json("entry", *s, &formatter);
+    }
+    formatter.close_section();
+    lderr(cct) << __func__ << "(): ERROR: deadlock detected, dumping remaining coroutines:\n";
+    formatter.flush(*_dout);
+    *_dout << dendl;
+    assert(context_stacks.empty() || going_down.read()); // assert on deadlock
+  }
+
   for (auto stack : context_stacks) {
     ldout(cct, 20) << "clearing stack on run() exit: stack=" << (void *)stack << " nref=" << stack->get_nref() << dendl;
     stack->put();