-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[sflow] Exception handling for if_nametoindex (#11437) #14457
[sflow] Exception handling for if_nametoindex (#11437) #14457
Conversation
catch system error and log as warning level instead of error level in case interface was already deleted Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
@Gokulnath-Raja can you re-trigger the CI? |
/AzurePipelines run Azure.sonic-buildimage |
Commenter does not have sufficient privileges for PR 14457 in repo sonic-net/sonic-buildimage |
please try '/azpw run Azure.sonic-buildimage' |
/azpw run Azure.sonic-buildimage |
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
@venkatmahalingam Can you review this? |
ifindex = None | ||
try: | ||
ifindex = if_nametoindex(ifname) | ||
except OSError as e: |
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.
Can we have the new code block only for SET operation?
thanks for the fix. @lguohan @qiluo-msft could you please merge? |
this is 202211 branch. @StormLiangMS , can you merge? |
This is Manual cherry-pick of #13567 |
Fix #11437
Why I did it
sflow process exited when failed to convert the interface index from interface name
How I did it
Added exception handling code and logged when OSError exception.
How to verify it
Recreated the bug scenario #11437 and ensured that sflow process not exited.
Description for the changelog
catch system error and log as warning level instead of
error level in case interface was already deleted.
Logs
steps :
syslogs :