Skip to content

Add check_pfc_storm_active() to fast-reboot script #3969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hdwhdw
Copy link
Contributor

@hdwhdw hdwhdw commented Jul 11, 2025

What I did

Added the check_pfc_storm_active() function to the fast-reboot script to ensure consistent PFC storm detection across all fast-reboot implementations.

How I did it

  • Added EXIT_PFC_STORM_DETECTED=25 exit code constant
  • Implemented check_pfc_storm_active() function that uses pfcwd show stats to detect active PFC storms
  • Updated reboot_pre_check() to call the new function before proceeding with reboot
  • The function aborts warm-reboot if PFC storm is detected to prevent failure in recovery path

How to verify it

  1. Run fast-reboot on a system without PFC storm - should proceed normally
  2. Simulate PFC storm condition and run fast-reboot - should abort with appropriate error message
  3. Verify the function is called during reboot pre-checks

Previous command output (if the output of a command-line utility has changed)

N/A - No change to command output, this is an internal safety check

New command output (if the output of a command-line utility has changed)

N/A - No change to command output, this is an internal safety check

Port the PFC storm detection function to ensure consistent behavior across all fast-reboot implementations.
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

{
# check if PFC storm is active (abort warmboot) or restored (proceed with warmboot)
PFC_STORMED="stormed"
pfcwd show stats | grep -i stormed || PFC_STORMED="not_stormed"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check if this value can be obtained from DB? Depending on grep is dangerous, particularly when it is not strict.

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.

3 participants