-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Mellanox] Bug fix: exception occurred during chassis object being destroyed #7446
Merged
liat-grozovik
merged 1 commit into
sonic-net:master
from
stephenxs:fix-chassis-destroy-error
Apr 29, 2021
Merged
[Mellanox] Bug fix: exception occurred during chassis object being destroyed #7446
liat-grozovik
merged 1 commit into
sonic-net:master
from
stephenxs:fix-chassis-destroy-error
Apr 29, 2021
Conversation
This file contains 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
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 <stephens@nvidia.com>
liat-grozovik
approved these changes
Apr 27, 2021
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
keboliu
approved these changes
Apr 29, 2021
@stephenxs not a blocker for this PR but i think it is better to add a test case to be sure it will not raise again (unit test or sonic-mgmt test case). |
daall
pushed a commit
that referenced
this pull request
Apr 29, 2021
…7446) 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, 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. - 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.
raphaelt-nvidia
pushed a commit
to raphaelt-nvidia/sonic-buildimage
that referenced
this pull request
May 23, 2021
…onic-net#7446) 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, 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. - 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.
carl-nokia
pushed a commit
to carl-nokia/sonic-buildimage
that referenced
this pull request
Aug 7, 2021
…onic-net#7446) 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, 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. - 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.
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 stephens@nvidia.com
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)