sonic-buildimage/platform
Junchao-Mellanox 9240bcb5b1
[Mellanox] Fix race condition while creating SFP (#17544)
Why I did it
Fix issue xcvrd crashes due to cannot import name 'initialize_sfp_thermal':

Nov 27 09:47:16.388639 sonic ERR pmon#xcvrd: Exception occured at CmisManagerTask thread due to ImportError("cannot import name 'initialize_sfp_thermal' from partially initialized module 'sonic_platform.thermal' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/sonic_platform/thermal.py)")
Nov 27 09:47:16.392544 sonic ERR pmon#xcvrd: Traceback (most recent call last):
Nov 27 09:47:16.392643 sonic ERR pmon#xcvrd:   File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1518, in run
Nov 27 09:47:16.392757 sonic ERR pmon#xcvrd:     self.task_worker()
Nov 27 09:47:16.392757 sonic ERR pmon#xcvrd:   File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1240, in task_worker
Nov 27 09:47:16.392757 sonic ERR pmon#xcvrd:     sfp = platform_chassis.get_sfp(pport)
Nov 27 09:47:16.392793 sonic ERR pmon#xcvrd:   File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 346, in get_sfp
Nov 27 09:47:16.392830 sonic ERR pmon#xcvrd:     self.initialize_single_sfp(index)
Nov 27 09:47:16.392830 sonic ERR pmon#xcvrd:   File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 288, in initialize_single_sfp
Nov 27 09:47:16.392830 sonic ERR pmon#xcvrd:     self._sfp_list[index] = sfp_module.SFP(index)
Nov 27 09:47:16.392830 sonic ERR pmon#xcvrd:   File "/usr/local/lib/python3.9/dist-packages/sonic_platform/sfp.py", line 272, in __init__
Nov 27 09:47:16.392866 sonic ERR pmon#xcvrd:     from .thermal import initialize_sfp_thermal
Nov 27 09:47:16.392918 sonic ERR pmon#xcvrd: ImportError: cannot import name 'initialize_sfp_thermal' from partially initialized module 'sonic_platform.thermal' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/sonic_platform/thermal.py)
Nov 27 09:47:16.393103 sonic ERR pmon#xcvrd: Xcvrd: exception found at child thread CmisManagerTask due to ImportError("cannot import name 'initialize_sfp_thermal' from partially initialized module 'sonic_platform.thermal' (most likely due to a circular import) (/usr/local/lib/python3.9/dist-packages/sonic_platform/thermal.py)")
Nov 27 09:47:16.393103 sonic ERR pmon#xcvrd: Exiting main loop as child thread raised exception!
Work item tracking
Microsoft ADO (number only):
How I did it
Add lock for creating SFP object

How to verify it
UNIT TEST
Manual Test
2023-12-19 19:52:42 +08:00
..
barefoot [202305] Update Linux kernel to 5.10.179 (#16958) 2023-10-23 22:37:30 +08:00
broadcom [Dell] S6100 - Update EEPROM API serial_number_str to return service tag instead of serial number (#17440) (#17494) 2023-12-16 01:44:16 +08:00
cavium [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
centec [202305] Update Linux kernel to 5.10.179 (#16958) 2023-10-23 22:37:30 +08:00
centec-arm64 [202305] Update Linux kernel to 5.10.179 (#16958) 2023-10-23 22:37:30 +08:00
checkout Update cisco-8000.ini to 202305.1.0.3 (#17417) 2023-12-06 14:22:56 +08:00
components [gearbox] use credo sai v0.9.3 (#16860) (#17126) 2023-11-09 17:26:34 +08:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium Add debug shell packages for Marvell Innovium platforms (#11845) 2023-04-13 22:04:36 +03:00
marvell [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
marvell-arm64 [Marvell-arm64] Support lazy install of sdk drivers (#17135) 2023-11-16 21:24:53 +08:00
marvell-armhf [Nokia-7215][armhf] Enable Watchdog service (#16612) (#17522) 2023-12-16 01:35:16 +08:00
mellanox [Mellanox] Fix race condition while creating SFP (#17544) 2023-12-19 19:52:42 +08:00
nephos [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
p4 [infra] Support syslog rate limit configuration (#12490) 2022-12-20 10:53:58 +02:00
pddf [pddf]: Adding S3IP supported attribute for FAN in PDDF (#15075) 2023-05-18 14:06:46 -07:00
s3ip-sysfs The CPLD and FPGA driver framework module complies with s3ip sysfs specification (#12891) 2022-12-16 22:05:53 +08:00
template Mount directory warmboot in docker gbsyncd (#11852) 2022-08-26 22:00:45 +08:00
vs [frr]: Force disable next hop group support. (#17344) (#17423) 2023-12-06 15:53:52 +08:00