Skip to content

Restart pmon in syncd.sh to clean up invalid fd#26864

Draft
ganglyu wants to merge 1 commit intosonic-net:masterfrom
ganglyu:restart_pmon
Draft

Restart pmon in syncd.sh to clean up invalid fd#26864
ganglyu wants to merge 1 commit intosonic-net:masterfrom
ganglyu:restart_pmon

Conversation

@ganglyu
Copy link
Copy Markdown
Contributor

@ganglyu ganglyu commented Apr 17, 2026

Why I did it

pmon holds file descriptors that become invalid when syncd restarts, causing pmon to malfunction. Stopping pmon before syncd starts/stops ensures pmon always restarts with clean state after syncd is ready.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. In syncd.sh startplatform(): stop pmon before syncd starts (non-warm-boot only), so pmon restarts cleanly after syncd is ready and invalid fds are cleared.
  2. In syncd.sh stopplatform1(): stop pmon ahead of syncd on Mellanox cold reboot, ensuring pmon does not hold stale fds during the shutdown sequence.
  3. In pmon.service.j2: added After=syncd.service for Mellanox, so systemd starts pmon only after syncd is up.

How to verify it

On a Mellanox device, perform a cold reboot and confirm:

  • pmon stops before syncd during shutdown
  • pmon starts after syncd comes up
  • No invalid fd errors in syslog after reboot

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants