Skip to content

Commit

Permalink
Cleanup stale servers only if marked DOWN, as the hints from discover…
Browse files Browse the repository at this point in the history
…y are

to be honored only if server is detected DOWN by agent.

Core is seen due to access of deleted AgentXmppChannel. AgentXmppChannel
was deleted as discovery sent new set of services even though the vrouter
did not detect the server as DOWN. (This happens only during
provisioning as the sytem is loaded and the heartbeats were not
recieved by discovery and it detects the control-node as DOWN)

Change-Id: I5b588baf59d1550d2a359dd5529074a16c873c02
Closes-Bug:1403295
  • Loading branch information
nipak committed Dec 29, 2014
1 parent 889376f commit 574e6e1
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/vnsw/agent/controller/controller_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,15 @@ void VNController::ApplyDiscoveryXmppServices(std::vector<DSResponse> resp) {
}

if (it == AgentXmppChannelList.end()) {
// not in list, cleanup
CONTROLLER_TRACE(DiscoveryConnection, "Cleanup Older Xmpp ",
agent_->controller_ifmap_xmpp_server(idx), "");
DisConnectControllerIfmapServer(idx);
agent_->reset_controller_ifmap_xmpp_server(idx);
// not in list, cleanup only if DOWN as new set of hints from
// discovery shud take effect only if agent detects the server DOWN
if (agent_->controller_xmpp_channel(idx)->GetXmppChannel()->
GetPeerState() == xmps::NOT_READY) {
CONTROLLER_TRACE(DiscoveryConnection, "Cleanup Older Xmpp ",
agent_->controller_ifmap_xmpp_server(idx), "");
DisConnectControllerIfmapServer(idx);
agent_->reset_controller_ifmap_xmpp_server(idx);
}
}
}
}
Expand Down Expand Up @@ -501,11 +505,15 @@ void VNController::ApplyDiscoveryDnsXmppServices(std::vector<DSResponse> resp) {
}

if (it == AgentDnsXmppChannelList.end()) {
// not in list, cleanup
CONTROLLER_TRACE(DiscoveryConnection, "Cleanup Older Dns Xmpp ",
agent_->dns_server(idx), "");
DisConnectDnsServer(idx);
agent_->reset_dns_server(idx);
// not in list, cleanup only if DOWN as new set of hints from
// discovery shud take effect only if agent detects the server DOWN
if (agent_->dns_xmpp_channel(idx)->GetXmppChannel()->GetPeerState()
== xmps::NOT_READY) {
CONTROLLER_TRACE(DiscoveryConnection, "Cleanup Older Dns Xmpp ",
agent_->dns_server(idx), "");
DisConnectDnsServer(idx);
agent_->reset_dns_server(idx);
}
}
}
}
Expand Down

0 comments on commit 574e6e1

Please sign in to comment.