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

[code sync] Merge code from sonic-net/sonic-platform-common:202405 to 202405 #21

Merged
merged 2 commits into from
Feb 15, 2025

Conversation

mssonicbld
Copy link
Collaborator

* fec0ad0 - (origin/202405) [cmis] Optimize cmis.get_error_description speed for passive module (#541) (2025-02-13) [mssonicbld]<br>```

mssonicbld and others added 2 commits February 13, 2025 04:02
…#541)

<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!--
 Describe your changes in detail
-->

cmis.get_error_description is very slow for passive module:

```
>>> begin = time.time()
>>> s.get_error_description()
'ModuleLowPwr'
>>> print(time.time() - begin)
2.905252695083618
```

For a module that has flat memory, it does not need check data path state. Because of this issue, `show error-status --fetch-from-hardware` takes very long time if there are many passive modules present:

```
real 1m12.116s
user 0m5.852s
sys 0m15.491s
```

After the fix, it changes to:

```
real 0m1.051s
user 0m0.499s
sys 0m0.059s
```

#### Motivation and Context
<!--
 Why is this change required? What problem does it solve?
 If this pull request closes/resolves an open Issue, make sure you
 include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->

Optimize cmis.get_error_description for passive module

#### How Has This Been Tested?
<!--
 Please describe in detail how you tested your changes.
 Include details of your testing environment, and the tests you ran to
 see how your change affects other areas of the code, etc.
-->

Manual test
Unit test

#### Additional Information (Optional)
@mssonicbld mssonicbld merged commit 6d32a64 into Azure:202405 Feb 15, 2025
3 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.

1 participant