This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/platform
Stephen Sun 48908b1c5a 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, 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.
2021-04-29 10:10:25 -07:00
..
barefoot [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
broadcom [202012] BRCM SAI 4.3.3.5 pick up 2 bug fixes and MMU changes () 2021-04-22 08:34:52 -07:00
cavium [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
centec [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
centec-arm64 [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' () 2020-06-11 16:04:23 -07:00
innovium [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
marvell [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
marvell-arm64 [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
marvell-armhf [marvell] Move armhf syncd build from stretch to buster. () 2021-04-21 15:40:52 -07:00
mellanox Fix issue: exception occurred during chassis object being destroyed () 2021-04-29 10:10:25 -07:00
nephos [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00
p4 Add support to start fdbsyncd when orchagent docker starts () 2020-12-24 18:36:01 -08:00
pddf [PDDF] Build and install Python 3 package () 2021-02-23 23:56:01 +00:00
template Add gearbox phy device files and a new physyncd docker to support VS gearbox phy feature () 2020-09-25 08:32:44 -07:00
vs [202012][dockers][supervisor] Increase event buffer size for process exit listener; Set all event buffer sizes to 1024 () 2021-04-01 12:52:19 -07:00