Skip to content

Commit

Permalink
Add mutual exclusion on Agent between xmpp::StateMachine and io::Read…
Browse files Browse the repository at this point in the history
…erTask.

TCP close event on a session is handled by xmpp::StateMachine task and
reads handled by io::ReaderTask, hence both tasks can be accessing the
same session at the same time and xmpp::StateMachine destroying the session
while io::ReaderTask reading it.

Change-Id: I09fbdf9b9ea6c31fb6072e7e2f8d40510f32dc03
Closes-Bug:1560242
  • Loading branch information
nipak committed May 11, 2016
1 parent ef7f45b commit ce74bc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/vnsw/agent/cmn/agent.cc
Expand Up @@ -205,6 +205,12 @@ void Agent::SetAgentTaskPolicy() {
SetTaskPolicyOne("http client", metadata_exclude_list,
sizeof(metadata_exclude_list) / sizeof(char *));

const char *xmpp_state_machine_exclude_list[] = {
"io::ReaderTask"
};
SetTaskPolicyOne("xmpp::StateMachine", xmpp_state_machine_exclude_list,
sizeof(xmpp_state_machine_exclude_list) / sizeof(char *));

const char *agent_init_exclude_list[] = {
"xmpp::StateMachine",
"http client",
Expand Down
4 changes: 0 additions & 4 deletions src/xmpp/xmpp_session.cc
Expand Up @@ -287,10 +287,6 @@ void XmppSession::OnRead(Buffer buffer) {
std::string::const_iterator st = buf_.begin();
std::string xml = string(st, offset_);

//
// XXX Connection gone ?
//
if (!connection_) break;
connection_->ReceiveMsg(this, xml);

} else {
Expand Down

0 comments on commit ce74bc8

Please sign in to comment.