Skip to content

[202305][orchagent.sh] mask SIGHUP before starting orchagent#22211

Closed
stepanblyschak wants to merge 1 commit intosonic-net:202305from
stepanblyschak:mask-sighup-2305
Closed

[202305][orchagent.sh] mask SIGHUP before starting orchagent#22211
stepanblyschak wants to merge 1 commit intosonic-net:202305from
stepanblyschak:mask-sighup-2305

Conversation

@stepanblyschak
Copy link
Collaborator

@stepanblyschak stepanblyschak commented Apr 2, 2025

BACKPORT of - #22207

Why I did it

FIXES #21962

logrotate uses SIGHUP to let orchagent reopen SAI Redis recording. If SIGHUP is sent by logrotate before orchagent register its handler the default action takes place - termination. If we mask the signal in the start script orchagent inherits masked signals and will ignore SIGHUP until signal handler is registered.

This is a rare race condition observed during 1000 warm-reboot testing.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Mask SIGHUP

How to verify it

Place sleep inside orchagent before signal handler for SIGHUP is registered. Send SIGHUP as if it would be sent from logrotate script, ensure no orchagent termination.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202405
  • 202411

Request to backport to all active branches.

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)

logrotate uses SIGHUP to let orchagent rotate SAI Redis recording. If
SIGHUP is sent by logrotate before orchagent register its handler the
default action takes place - termination. If we mask the signal in the
start script orchagent inherits masked signals and will ignore SIGHUP
until signal handler is registered.

This is a rare race condition observed during 1000 warm-reboot testing.

Signed-off-by: Stepan Blyschak <[email protected]>
@stepanblyschak stepanblyschak requested a review from lguohan as a code owner April 2, 2025 09:37
@stepanblyschak
Copy link
Collaborator Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@bingwang-ms would you like to merge it to 202305? if not, we can close the PR but you should be aware of this issue.

@stepanblyschak
Copy link
Collaborator Author

Closing due to no interest merging to 202305

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.

4 participants