Skip to content

Comments

[code sync] Merge code from sonic-net/sonic-platform-common:202505 to 202506#109

Merged
mssonicbld merged 2 commits intoAzure:202506from
mssonicbld:sonicbld/202506-merge
Sep 26, 2025
Merged

[code sync] Merge code from sonic-net/sonic-platform-common:202505 to 202506#109
mssonicbld merged 2 commits intoAzure:202506from
mssonicbld:sonicbld/202506-merge

Conversation

@mssonicbld
Copy link
Collaborator

* 2c5fd51 - (origin/202505) [Smartswitch] Restart sensord with lock (#602) (2025-09-26) [mssonicbld]<br>```

mssonicbld and others added 2 commits September 26, 2025 08:12
<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!--
 Describe your changes in detail
-->

#### Motivation and Context
<!--
 Why is this change required? What problem does it solve?
 If this pull request closes/resolves an open Issue, make sure you
 include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
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?
<!--
 Please describe in detail how you tested your changes.
 Include details of your testing environment, and the tests you ran to
 see how your change affects other areas of the code, etc.
-->
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 mssonicbld merged commit 7f01aea into Azure:202506 Sep 26, 2025
3 checks passed
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.

1 participant