Skip to content

Commit

Permalink
Fix end of rib logic in channel to handle all message types.
Browse files Browse the repository at this point in the history
Currently, to determine that we have received all data, we were depending the
message type 'SearchResult'.

But, there can be cases, where the first batch of data is received in an
'UpdateResult' i.e. when the connection to the ifmap-server goes up,
ifmap-server does not have any data to begin with. Then, later when config is
added, the data will come in as an 'UpdateResult'. The code is processing the
EOR logic only for SearchResults which is incorrect. Fixing that.

Change-Id: I0106c62e8bec2cbf06a25efc1856451273d7df1f
Closes-Bug: #1501425
  • Loading branch information
tkarwa committed Sep 30, 2015
1 parent cc4719d commit 08866ba
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/ifmap/client/ifmap_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,18 +616,21 @@ int IFMapChannel::ReadPollResponse() {
"Incorrectly formatted Poll response. Quitting.", "");
return -1;
}
if (reply_str.find(string("searchResult")) != string::npos) {
if (start_stale_entries_cleanup()) {
// If this is a reconnection, keep re-arming the stale entries
// cleanup timer as long as we keep receiving SearchResults.
StartStaleEntriesCleanupTimer();
}
// When the daemon is coming up, as long as we are receiving
// SearchResults, we have not received the entire db.
if (!end_of_rib_computed()) {
StartEndOfRibTimer();
}

// Manage timers.
if (start_stale_entries_cleanup()) {
// If this is a reconnection, keep re-arming the stale entries
// cleanup timer as long as we keep receiving data.
StartStaleEntriesCleanupTimer();
}
if (!end_of_rib_computed()) {
// When the daemon is coming up, as long as we are receiving data,
// we have not received the entire db. Keep re-arming the EOR timer
// as long as we are receiving data.
StartEndOfRibTimer();
}

// Send the message to the parser for further processing.
string poll_string = reply_str.substr(pos);
increment_recv_msg_cnt();
bool success = true;
Expand Down

0 comments on commit 08866ba

Please sign in to comment.