Skip to content

Commit

Permalink
Merge pull request #11580 from cbodley/wip-rgw-deadlock-dump-crs
Browse files Browse the repository at this point in the history
rgw: dump remaining coroutines when cr deadlock is detected

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Oct 20, 2016
2 parents 71d4043 + d66dfa2 commit 4e4feb0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rgw/rgw_coroutine.cc
Expand Up @@ -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();
Expand Down

0 comments on commit 4e4feb0

Please sign in to comment.