Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[neighmgrd]: Check warmboot flag during nbrmgr init #1057

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions cfgmgr/nbrmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "exec.h"
#include "schema.h"
#include "nbrmgr.h"
#include "warm_restart.h"

using namespace std;
using namespace swss;
Expand Down Expand Up @@ -54,19 +55,25 @@ int main(int argc, char **argv)

NbrMgr nbrmgr(&cfgDb, &appDb, &stateDb, cfg_nbr_tables);

chrono::steady_clock::time_point starttime = chrono::steady_clock::now();
while (!nbrmgr.isNeighRestoreDone())
WarmStart::initialize("nbrmgrd", "swss");
WarmStart::checkWarmStart("nbrmgrd", "swss");

if (WarmStart::isWarmStart())
{
chrono::duration<double> time_span = chrono::duration_cast<chrono::duration<double>>
(chrono::steady_clock::now() - starttime);
int pasttime = int(time_span.count());
SWSS_LOG_INFO("Kernel neighbor table restoration waited for %d seconds", pasttime);
if (pasttime > RESTORE_NEIGH_WAIT_TIME_OUT)
chrono::steady_clock::time_point starttime = chrono::steady_clock::now();
while (!nbrmgr.isNeighRestoreDone())
{
SWSS_LOG_WARN("Kernel neighbor table restore is not finished!");
break;
chrono::duration<double> time_span = chrono::duration_cast<chrono::duration<double>>
(chrono::steady_clock::now() - starttime);
int pasttime = int(time_span.count());
SWSS_LOG_INFO("Kernel neighbor table restoration waited for %d seconds", pasttime);
if (pasttime > RESTORE_NEIGH_WAIT_TIME_OUT)
{
SWSS_LOG_WARN("Kernel neighbor table restore is not finished!");
break;
}
sleep(RESTORE_NEIGH_WAIT_TIME_INT);
}
sleep(RESTORE_NEIGH_WAIT_TIME_INT);
}

std::vector<Orch *> cfgOrchList = {&nbrmgr};
Expand Down