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

[System ready] Report ready state to Sysmonitor daemon #3126

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
8 changes: 8 additions & 0 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ int main(int argc, char **argv)
DBConnector appl_db("APPL_DB", 0);
DBConnector state_db("STATE_DB", 0);
ProducerStateTable p(&appl_db, APP_PORT_TABLE_NAME);
Table feature(&state_db, "FEATURE");

Table cfgDeviceMetaDataTable(&cfgDb, CFG_DEVICE_METADATA_TABLE_NAME);
if (!cfgDeviceMetaDataTable.hget("localhost", "switch_type", g_switchType))
Expand Down Expand Up @@ -134,6 +135,13 @@ int main(int argc, char **argv)
p.set("PortInitDone", attrs);
SWSS_LOG_NOTICE("PortInitDone");

/*
* Notify "System ready" feature that we are ok.
*/
FieldValueTuple app_state("up_status", "true");
fastiuk marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be some code to set it "false"?

  1. when orchagent starts
  2. when orchagent exited gracefully
  3. when orchagent receive a signal and exited
  4. etc.

vector<FieldValueTuple> feature_attrs = { app_state };
feature.set("swss", feature_attrs);
fastiuk marked this conversation as resolved.
Show resolved Hide resolved

g_init = true;
}
}
Expand Down
Loading