Skip to content

Commit

Permalink
Use abort instead of exit in case calling SAI API failure
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephenxs committed Mar 2, 2022
1 parent 6e5ed1c commit b3e5e33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,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());
exit(EXIT_FAILURE);
abort();
}
break;
case SAI_API_HOSTIF:
Expand All @@ -865,7 +865,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());
exit(EXIT_FAILURE);
abort();
}
default:
switch (status)
Expand All @@ -876,7 +876,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());
exit(EXIT_FAILURE);
abort();
}
}
return task_need_retry;
Expand Down Expand Up @@ -917,12 +917,12 @@ 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());
exit(EXIT_FAILURE);
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());
exit(EXIT_FAILURE);
abort();
}

return task_need_retry;
Expand Down Expand Up @@ -950,7 +950,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());
exit(EXIT_FAILURE);
abort();
}
return task_need_retry;
}
Expand Down
2 changes: 1 addition & 1 deletion orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void OrchDaemon::flush()
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to flush redis pipeline %d", status);
exit(EXIT_FAILURE);
abort();
}

// check if logroate is requested
Expand Down

0 comments on commit b3e5e33

Please sign in to comment.