From 74df1494d04ca75dae1305b96faf5e0c16827a50 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 27 Jan 2022 13:36:56 +0800 Subject: [PATCH] [Mellanox] Fix select timeout in sfp event (#9795) - Why I did it Python select.select accept a optional timeout value in seconds, however, the value passes to it is a value in millisecond. - How I did it Transfer the value to millisecond. - How to verify it Manual test --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py index 669c49db8131..519d038ff326 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -257,7 +257,7 @@ def check_sfp_status(self, port_change, error_dict, timeout): found = 0 try: - read, _, _ = select.select([self.rx_fd_p.fd], [], [], timeout) + read, _, _ = select.select([self.rx_fd_p.fd], [], [], float(timeout) / 1000) print(read) except select.error as err: rc, msg = err