Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:13611] [Mellanox] set select timeout to no more than 1 sec to make sure fast shutdown #16448

Merged
merged 1 commit into from
Sep 5, 2023

Commits on Sep 5, 2023

  1. [Mellanox] set select timeout to no more than 1 sec to make sure fast…

    … shutdown (sonic-net#13611)
    
    - 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 sonic-net#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
    Junchao-Mellanox authored and mssonicbld committed Sep 5, 2023
    Configuration menu
    Copy the full SHA
    9d3251c View commit details
    Browse the repository at this point in the history