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 10, 2016
1 parent 58e5c28 commit 3532c2f
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 @@ -250,6 +250,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 @@ -298,10 +298,6 @@ void XmppSession::OnRead(Buffer buffer) {
break;
}

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

} else {
Expand Down

0 comments on commit 3532c2f

Please sign in to comment.