Skip to content

Commit

Permalink
Merge pull request ceph#6933 from jcsp/wip-14048
Browse files Browse the repository at this point in the history
mds: tear down connections from `tell` commands
  • Loading branch information
ukernel committed Dec 24, 2015
2 parents a297608 + b1429aa commit 749c424
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mds/MDSDaemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,21 @@ void MDSDaemon::handle_command(MCommand *m)
r = _handle_command(cmdmap, m->get_data(), &outbl, &outs, &run_after);
}

// If someone is using a closed session for sending commands (e.g.
// the ceph CLI) then we should feel free to clean up this connection
// as soon as we've sent them a response.
const bool live_session = mds_rank &&
mds_rank->sessionmap.get_session(session->info.inst.name) != nullptr
&& session->get_state_seq() > 0;

if (!live_session) {
// This session only existed to issue commands, so terminate it
// as soon as we can.
assert(session->is_closed());
session->connection->mark_disposable();
session->put();
}

MCommandReply *reply = new MCommandReply(r, outs);
reply->set_tid(m->get_tid());
reply->set_data(outbl);
Expand Down

0 comments on commit 749c424

Please sign in to comment.