[action] [PR:206] hamgrd: ignore DPU HA set/scope state deletion messages#207
Merged
Merged
Conversation
## Description of PR `get_dpu_ha_set_state` and `get_dpu_ha_scope_state` previously deserialized every incoming `DASH_HA_SET_STATE` / `DASH_HA_SCOPE_STATE` message regardless of the DB operation. A `Del` message carries empty field values, so it could be misinterpreted as an (empty) state update rather than being ignored. This PR adds an explicit `KeyOperation::Del` check to both accessors so deletion notifications are logged at debug level and skipped (returning `None`), which causes the callers to ignore them. ## Type of change - [x] Bug fix Fix sonic-net/sonic-buildimage#28162 ## Approach **How it works:** Both accessor functions now inspect `kfv.operation` after deserializing the `KeyOpFieldValues`. When the operation is `KeyOperation::Del`, they return `None` early instead of attempting to deserialize the (empty) field values. **How it was verified:** `cargo test -p hamgrd` — all 41 unit tests pass, including the ha_set and ha_scope NPU/DPU suites. Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Author
|
Original PR: #206 |
1 task
Author
|
/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.
Description of PR
get_dpu_ha_set_stateandget_dpu_ha_scope_statepreviously deserialized every incomingDASH_HA_SET_STATE/DASH_HA_SCOPE_STATEmessage regardless of the DB operation. ADelmessage carries empty field values, so it could be misinterpreted as an (empty) state update rather than being ignored.This PR adds an explicit
KeyOperation::Delcheck to both accessors so deletion notifications are logged at debug level and skipped (returningNone), which causes the callers to ignore them.Type of change
Fix Bug: [HA] hamgrd logs deserialization errors for HA state delete messages without last_updated_time sonic-buildimage#28162
Approach
How it works: Both accessor functions now inspect
kfv.operationafter deserializing theKeyOpFieldValues. When the operation isKeyOperation::Del, they returnNoneearly instead of attempting to deserialize the (empty) field values.How it was verified:
cargo test -p hamgrd— all 41 unit tests pass, including the ha_set and ha_scope NPU/DPU suites.Signed-off-by: Sonic Build Admin sonicbld@microsoft.com