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/mellanox/mlnx-platform-api
mssonicbld 89f091eded
[Mellanox] set select timeout to no more than 1 sec to make sure fast shutdown (#13611) (#16449)
- Why I did it
Commit sonic-net/sonic-platform-daemons@153ea47 changed SfpStateUpdateTask from Process to Thread. In this commit, it raises an exception in SfpStateUpdateTask to make shutdown flow fast. But it does not work on Nvidia platform as Nvidia platform is passing timeout parameter of get_change_event to select. Linux select function can not be interrupted by a Python exception. There is no such issue on Nvidia platform before that commit. However, in order to comply with the commit and make shutdown flow fast, we decided to change Nvidia platform API implementation.

To fix issue #13591.

- How I did it
The select call in get_change_event should use no more than 1 second as timeout parameter.
Outside the select call, add a while loop to make sure timeout parameter of get_change_event work as expected

- How to verify it
Manual test

Co-authored-by: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com>
2023-09-05 21:53:08 -07:00
..
sonic_platform [Mellanox] set select timeout to no more than 1 sec to make sure fast shutdown (#13611) (#16449) 2023-09-05 21:53:08 -07:00
tests [Mellanox] Fix issue: watchdogutil command does not work (#16091) (#16260) 2023-08-25 17:01:37 -07:00
.gitignore [Mellanox] Refactor Mellanox platform API to support dynamic port configuration (#8422) 2021-10-25 07:59:06 +03:00
pytest.ini [Mellanox] Refactor Mellanox platform API to support dynamic port configuration (#8422) 2021-10-25 07:59:06 +03:00
setup.cfg Add thermal control support for SONiC (#3949) 2020-03-09 10:41:10 -07:00
setup.py [Mellanox] Add NVIDIA Copyright header to "mellanox" files (#8799) 2021-10-17 19:03:02 +03:00