Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: dump remaining coroutines when cr deadlock is detected #11580

Merged
merged 1 commit into from Oct 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley shouldn't we use _derr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is referring to the std::ostream* _dout variable from the dout_impl macro in common/dout.h, which the other dout/derr macros are using

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. it's the stream associated with the lderr() on the line above, and closed with dendl on the line below

*_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