-
Notifications
You must be signed in to change notification settings - Fork 693
[orchagent] Set ABRT signal in STATE_DB during a SAI failure #2556
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
Changes from all commits
bda046e
3b58799
b8fd6e6
2caf395
2f67282
aa4d986
b66ccc3
0e2a8d2
8e18792
0edd3e6
565969c
756bdc2
c60629d
6a4140e
a3153ff
0c53d4b
715cc1e
ec27109
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,14 @@ extern ofstream gRecordOfs; | |
| extern bool gLogRotate; | ||
| extern string gRecordFile; | ||
|
|
||
| void notifyAbort(){ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. API name is not aligned to the functionality. This is doing both notify and abort. API gives the indication that it is only notification. Please move abort to original code and use it only to notify or change the name to say
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will update
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handled |
||
| /* | ||
| * This function sets the ORCH_ABORT_STATUS flag in STATE_DB and aborts itself | ||
| */ | ||
| swss::DBConnector m_db("STATE_DB", 0); | ||
| m_db.set(ORCH_ABRT, "1"); | ||
| } | ||
|
|
||
| Orch::Orch(DBConnector *db, const string tableName, int pri) | ||
| { | ||
| addConsumer(db, tableName, pri); | ||
|
|
@@ -887,6 +895,7 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat | |
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in create operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
| break; | ||
|
|
@@ -905,6 +914,7 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat | |
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in create operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
| default: | ||
|
|
@@ -916,6 +926,7 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat | |
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in create operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
| } | ||
|
|
@@ -957,11 +968,13 @@ task_process_status Orch::handleSaiSetStatus(sai_api_t api, sai_status_t status, | |
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in set operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in set operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
|
|
||
|
|
@@ -990,6 +1003,7 @@ task_process_status Orch::handleSaiRemoveStatus(sai_api_t api, sai_status_t stat | |
| default: | ||
| SWSS_LOG_ERROR("Encountered failure in remove operation, exiting orchagent, SAI API: %s, status: %s", | ||
| sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str()); | ||
| notifyAbort(); | ||
| abort(); | ||
| } | ||
| return task_need_retry; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest have flush table at common place - https://github.com/sonic-net/sonic-buildimage/blob/master/files/scripts/swss.sh#L177
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That can be done, but clearing it here gives more time buffer to the processes dependent on this flag.