Skip to content

[202311][orchagent.sh] mask SIGHUP before starting orchagent#22210

Merged
yxieca merged 1 commit intosonic-net:202311from
stepanblyschak:mask-sighup-2311
Apr 30, 2025
Merged

[202311][orchagent.sh] mask SIGHUP before starting orchagent#22210
yxieca merged 1 commit intosonic-net:202311from
stepanblyschak:mask-sighup-2311

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:34
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@stepanblyschak
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

1 similar comment
@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@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).

@yxieca yxieca merged commit 88617c7 into sonic-net:202311 Apr 30, 2025
17 checks passed
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