[pfcwd]: Reject start when detection or restoration time is below polling interval#4599
Open
Bojun-Feng wants to merge 1 commit into
Open
[pfcwd]: Reject start when detection or restoration time is below polling interval#4599Bojun-Feng wants to merge 1 commit into
Bojun-Feng wants to merge 1 commit into
Conversation
…ling interval * Add validation in start_cmd to reject detection_time < configured POLL_INTERVAL * Add validation in start_cmd to reject restoration_time < configured POLL_INTERVAL * Fix existing tests that used detection_time below POLL_INTERVAL (nonsensical values) * Add rejection tests: detection_time only, restoration_time only Signed-off-by: Bojun-Feng <bojundf@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Fix #4520
Added validation to reject
pfcwd startwhen detection time or restoration time is smaller than the configured polling interval. Previously, the CLI accepted any value within the Click argument range (100–5000ms for detection, 100–60000ms for restoration) without cross-checking against the global POLL_INTERVAL. This results in a nonsensical configuration where the watchdog cannot accurately detect or restore within the configured timeframe.The reverse direction is already validated.
pfcwd intervalrejects values exceeding any configured detection/restoration time. The YANG model also enforces both constraints viamustclauses, but only duringconfig load/ GCU operations and not through thepfcwd startCLI path which writes directly to ConfigDB.Also fixed existing unit tests that were using detection/restoration values below the mock POLL_INTERVAL, which were never caught because no validation existed.
How I did it
POLL_INTERVALfromPFC_WD|GLOBALinstart_cmdbefore writing config, reject invalid settingsintervalcommand)How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)