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

[action] [PR:322] [ciscoPfcExtMIB]: Remove returning first intf index if subid is empty (#322) #328

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

mssonicbld
Copy link
Collaborator

  • What I did
    When querying for PFC counters MIB cpfcIfTable if there is no interface present on the device, then there is an exception while handing get_next as the implementation tries to return the first index of an empty list.
    This happens in case of VoQ chassis Supervisor where there are no interfaces present.
    Anytime a snmp query is made to cpfcIfTable 1.3.6.1.4.1.9.9.813.1.1, the exception message gets logged on the device.

  • How I did it
    Currently if sub_id is None, if_range[0] is returned. IF if_range is empty array this can cause an Exception.
    Removed this check to avoid returning if_range[0].
    The check "if not sub_id" is not required here.
    right = bisect_right(self.if_range, sub_id) will handle if the sub_id is empty or if the if_range is empty by returning 0 index.

  • How to verify it
    Verified that no exception is logged upon query in VoQ chassis supervisor.
    Other platforms like Linecard, single-asic device - no Change in the SNMP result.

…sonic-net#322)

- What I did
When querying for PFC counters MIB cpfcIfTable if there is no interface present on the device, then there is an exception while handing get_next as the implementation tries to return the first index of an empty list.
This happens in case of VoQ chassis Supervisor where there are no interfaces present.
Anytime a snmp query is made to cpfcIfTable 1.3.6.1.4.1.9.9.813.1.1, the exception message gets logged on the device.

- How I did it
Currently if sub_id is None, if_range[0] is returned. IF if_range is empty array this can cause an Exception.
Removed this check to avoid returning if_range[0].
The check "if not sub_id" is not required here.
right = bisect_right(self.if_range, sub_id) will handle if the sub_id is empty or if the if_range is empty by returning 0 index.

- How to verify it
Verified that no exception is logged upon query in VoQ chassis supervisor.
Other platforms like Linecard, single-asic device - no Change in the SNMP result.
@mssonicbld
Copy link
Collaborator Author

Original PR: #322

@mssonicbld mssonicbld merged commit 5fec35f into sonic-net:202405 Aug 24, 2024
4 checks passed
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.

2 participants