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

[Mellanox] Bug fix: exception occurred during chassis object being destroyed #66

Closed
wants to merge 1 commit into from

Commits on Apr 26, 2021

  1. Fix issue: exception occurred during chassis object being destroyed

    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]>
    stephenxs committed Apr 26, 2021
    Configuration menu
    Copy the full SHA
    a35753a View commit details
    Browse the repository at this point in the history