Skip to content

[Smartswitch] Restart sensord with lock#594

Merged
judyjoseph merged 1 commit intosonic-net:masterfrom
gpunathilell:sensord_restart
Sep 17, 2025
Merged

[Smartswitch] Restart sensord with lock#594
judyjoseph merged 1 commit intosonic-net:masterfrom
gpunathilell:sensord_restart

Conversation

@gpunathilell
Copy link
Contributor

@gpunathilell gpunathilell commented Sep 9, 2025

Description

Motivation and Context

On startup of pmon in dark mode on switch, there are four processes spawned to power off DPUs, if all are executed in parallel there are four sensord processes running (since service restart commands are not queued). Since we perform handle_sensor_removal on dark mode start, the solution is to have a file lock to make sure only one module has control to restart sensord each time, queueing the sensord restart requests so that we have a single process running always, irrespective of number of restarts

How Has This Been Tested?

Check the number of sensord processes starting before fix:

docker exec -it pmon ps -x|grep sensord
    170 ?        Ss     0:00 /usr/sbin/sensord -f daemon
    171 ?        Ss     0:00 /usr/sbin/sensord -f daemon
    172 ?        Ss     0:00 /usr/sbin/sensord -f daemon
    173 ?        Ss     0:00 /usr/sbin/sensord -f daemon

after Addition of fix, only one process is found

root@sonic:/home/admin# docker exec -it pmon ps -x|grep sensord
    189 ?        Ss     0:00 /usr/sbin/sensord -f daemon

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@vvolam vvolam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you

@vvolam
Copy link
Contributor

vvolam commented Sep 16, 2025

@judyjoseph could you help with merge this PR?

@judyjoseph judyjoseph merged commit 499d775 into sonic-net:master Sep 17, 2025
5 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-platform-common.msft#108

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants