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

Use abort instead of exit in case calling SAI API failure #2170

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

stephenxs
Copy link
Collaborator

What I did
Use abort instead of exit in case calling SAI API failure
Currently, exit is used in functions handleSai{Create,Remove,Set,Get}Status on SAI failure while abort is used in some other functions on SAI failure.
IMO using abort yields benefits:

  • consistent behavior in orchagent on SAI failure
  • in mocked test, in case SAI failure occurs the test process will just exit silently, which makes it very difficult for developers to find out what happened. by using abort, a coredump will be generated, which helps developers nail down the issue.

So we would like to use abort in all cases of receiving SAI failure.

Signed-off-by: Stephen Sun [email protected]

Why I did it

How I verified it

Manually test.

Details if related

@stephenxs stephenxs requested a review from prsunny as a code owner March 7, 2022 02:52
@stephenxs
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs
Copy link
Collaborator Author

it can be cherry-picked to 202111 smoothly (tested on b3e5e33)

@stephenxs
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik liat-grozovik merged commit 29d5d8d into sonic-net:master Mar 9, 2022
@stephenxs stephenxs deleted the abort-on-failure branch March 9, 2022 07:17
judyjoseph pushed a commit that referenced this pull request Mar 20, 2022
- What I did
Use abort instead of exit in case calling SAI API failure
Currently, exit is used in functions handleSai{Create,Remove,Set,Get}Status on SAI failure while abort is used in some other functions on SAI failure.
IMO using abort yields benefits:

Consistent behavior in orchagent on SAI failure in mocked test, in case SAI failure occurs the test process will just exit silently, which makes it very difficult for developers to find out what happened. by using abort, a coredump will be generated, which helps developers nail down the issue.
So we would like to use abort in all cases of receiving SAI failure.

- Why I did it

- How I verified it
Manually test.

Signed-off-by: Stephen Sun <[email protected]>
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
…2170)

- What I did
Use abort instead of exit in case calling SAI API failure
Currently, exit is used in functions handleSai{Create,Remove,Set,Get}Status on SAI failure while abort is used in some other functions on SAI failure.
IMO using abort yields benefits:

Consistent behavior in orchagent on SAI failure in mocked test, in case SAI failure occurs the test process will just exit silently, which makes it very difficult for developers to find out what happened. by using abort, a coredump will be generated, which helps developers nail down the issue.
So we would like to use abort in all cases of receiving SAI failure.

- Why I did it

- How I verified it
Manually test.

Signed-off-by: Stephen Sun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants