Skip to content

Commit

Permalink
Merge pull request #10500: jewel: Fix shutting down mds timed-out due…
Browse files Browse the repository at this point in the history
… to deadlock

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Aug 8, 2016
2 parents b0e1360 + 1d3a816 commit 5e63e77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/mds/MDSRank.cc
Expand Up @@ -244,7 +244,11 @@ void MDSRankDispatcher::shutdown()
finisher->stop(); // no flushing

// shut down messenger
// release mds_lock first because messenger thread might call
// MDSDaemon::ms_handle_reset which will try to hold mds_lock
mds_lock.Unlock();
messenger->shutdown();
mds_lock.Lock();

mds_lock.Lock();

Expand Down
4 changes: 2 additions & 2 deletions src/msg/async/Event.cc
Expand Up @@ -262,15 +262,15 @@ void EventCenter::delete_time_event(uint64_t id)

void EventCenter::wakeup()
{
if (already_wakeup.compare_and_swap(0, 1)) {
ldout(cct, 1) << __func__ << dendl;
already_wakeup.compare_and_swap(0, 1);

char buf[1];
buf[0] = 'c';
// wake up "event_wait"
int n = write(notify_send_fd, buf, 1);
// FIXME ?
assert(n == 1);
}
}

int EventCenter::process_time_events()
Expand Down

0 comments on commit 5e63e77

Please sign in to comment.