Skip to content

Commit eb8a223

Browse files
authored
[xcvrd] Force cleanup of chassis global variable on deinit (sonic-net#193)
- Description I added a del directive for the global platform_chassis object in xcvrd on deinit to ensure that the pointer is properly cleaned up such that the __del__() method is successfully called on the chassis object which closes its connection to SAI. - Motivation and Context On Mellanox platforms on 202012 we are seeing that in some cases xcvrd is maintaining the socket to the API past its deconstruction causing an error from SAI. This was traced by reproducing the issue and identifying that the pmon container was causing this issue where xcvrd is the only daemon within pmon that opens a SDK socket on Mellanox. Error in log... syncd#SDK: [SX_API_INTERNAL.ERR] Failed command read at communication channel: Connection reset by peer - How Has This Been Tested? Change was uploaded to xcvrd on running pmon container on a switch running the latest 202012 build. xcvrd was then restarted with supervisord and we verified that we could no longer reproduce the bug.
1 parent a6903c0 commit eb8a223

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sonic-xcvrd/xcvrd/xcvrd.py

+2
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,8 @@ def deinit(self):
13531353
if self.y_cable_presence[0] is True:
13541354
y_cable_helper.delete_ports_status_for_y_cable()
13551355

1356+
del globals()['platform_chassis']
1357+
13561358
# Run daemon
13571359

13581360
def run(self):

0 commit comments

Comments
 (0)