[Mellanox] Bug fix: exception occurred during chassis object being destroyed#66
Closed
[Mellanox] Bug fix: exception occurred during chassis object being destroyed#66
Conversation
The following error message is observed during chassis object being destroyed ``` Exception ignored in: <function Chassis.__del__ at 0x7fd22165cd08> Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/sonic_platform/chassis.py", line 83, in __del__ ImportError: sys.meta_path is None, Python is likely shutting down ``` The chassis tries to import deinitialize_sdk_handle during being destroyed for the purpose of releasing the sdk_handle. However, to import another module during shutting down can causing error because some of the fundamental infrastructure is no longer available. To fix it, record the deinitialize_sdk_handle in chassis object when sdk_handle is being initialized and call the deinitialize handler when chassis object is being destroyed Signed-off-by: Stephen Sun <[email protected]>
keboliu
approved these changes
Apr 27, 2021
stephenxs
pushed a commit
that referenced
this pull request
May 19, 2022
[sonic-linkmgrd][202012] submodule update 3d13ff2 Jing Zhang Wed May 4 10:07:14 2022 -0700 Add doc for default route related changes (#63) c703be4 Jing Zhang Mon May 2 13:27:54 2022 -0700 Reset WaitActiveUp count before switching to active (#70) 86eb727 Jing Zhang Wed Apr 27 10:35:05 2022 -0700 lower log level to warning (#69) e22c736 Jing Zhang Mon May 2 13:33:24 2022 -0700 [202012] Avoid proactively switching to active if default route is missing (#67) d4f282b Jing Zhang Thu Apr 28 18:35:11 2022 -0700 [202012] Add support to enable switchover time measurement (with link prober interval decreased to 10ms) feature (#66) sign-off: Jing Zhang [[email protected]](mailto:[email protected])
stephenxs
pushed a commit
that referenced
this pull request
May 24, 2024
…ically (sonic-net#19036) #### Why I did it src/sonic-dbsyncd ``` * d5fa793 - (HEAD -> master, origin/master, origin/HEAD) Handle exception to avoid lldp_syncd crash (#65) (2 hours ago) [Zhaohui Sun] * bc63571 - Fix pipeline issue. (#66) (25 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog
stephenxs
pushed a commit
that referenced
this pull request
Feb 19, 2025
…ly (sonic-net#21340) #### Why I did it src/dhcprelay ``` * 13d7f5a - (HEAD -> 202411, origin/202411) Add wait and check ip address check when dhcp6relay init (#52) (#66) (25 hours ago) [mssonicbld] * 1e7b13a - [202411] Clear counter when dhcp6relay init (#51) (#65) (4 days ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
stephenxs
pushed a commit
that referenced
this pull request
Jul 23, 2025
…ically (sonic-net#23192) #### Why I did it src/sonic-dash-ha ``` * b18e019 - (HEAD -> master, origin/master, origin/HEAD) Implement dpu actor (#66) (6 hours ago) [yue-fred-gao] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
The following error message is observed during chassis object being destroyed
The chassis tries to import deinitialize_sdk_handle during being destroyed for the purpose of releasing the sdk_handle.
However, importing another module during shutting down can cause the error because some of the fundamental infrastructures are no longer available.
This error occurs when a chassis object is created and then destroyed in the Python shell.
Signed-off-by: Stephen Sun [email protected]
How I did it
To fix it, record the deinitialize_sdk_handle in the chassis object when sdk_handle is being initialized and call the deinitialize handler when the chassis object is being destroyed
How to verify it
Manually test.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)