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

[202012][orchagent]: Handle additional SAI error conditions gracefully #2764

Draft
wants to merge 2 commits into
base: 202012
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .azure-pipelines/build-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
allowPartiallySucceededBuilds: true
displayName: "Download sonic swss common deb packages"
- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -51,6 +52,7 @@ jobs:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
allowPartiallySucceededBuilds: true
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
allowPartiallySucceededBuilds: true
patterns: |
libswsscommon_1.0.0_${{ parameters.arch }}.deb
libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
Expand All @@ -96,6 +97,7 @@ jobs:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
allowPartiallySucceededBuilds: true
patterns: |
libsaivs_*.deb
libsaivs-dev_*.deb
Expand Down
36 changes: 36 additions & 0 deletions orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,26 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat
/* With VNET routes, the same route can be learned via multiple
sources, like via BGP. Handle this gracefully */
return task_success;
case SAI_STATUS_TABLE_FULL:
return task_need_retry;
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);
}
break;
case SAI_API_NEIGHBOR:
case SAI_API_NEXT_HOP:
case SAI_API_NEXT_HOP_GROUP:
switch(status)
{
case SAI_STATUS_SUCCESS:
SWSS_LOG_WARN("SAI_STATUS_SUCCESS is not expected in handleSaiCreateStatus");
return task_success;
case SAI_STATUS_ITEM_ALREADY_EXISTS:
return task_success;
case SAI_STATUS_TABLE_FULL:
return task_need_retry;
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());
Expand Down Expand Up @@ -944,6 +964,22 @@ task_process_status Orch::handleSaiRemoveStatus(sai_api_t api, sai_status_t stat
exit(EXIT_FAILURE);
}
break;
case SAI_API_NEIGHBOR:
case SAI_API_NEXT_HOP:
case SAI_API_NEXT_HOP_GROUP:
switch (status)
{
case SAI_STATUS_SUCCESS:
SWSS_LOG_WARN("SAI_STATUS_SUCCESS is not expected in handleSaiRemoveStatus");
return task_success;
case SAI_STATUS_ITEM_NOT_FOUND:
return task_success;
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);
}
break;
default:
switch (status)
{
Expand Down