Skip to content

[action] [PR:206] hamgrd: ignore DPU HA set/scope state deletion messages#207

Merged
mssonicbld merged 1 commit into
sonic-net:202605from
mssonicbld:cherry/202605/206
Jul 13, 2026
Merged

[action] [PR:206] hamgrd: ignore DPU HA set/scope state deletion messages#207
mssonicbld merged 1 commit into
sonic-net:202605from
mssonicbld:cherry/202605/206

Conversation

@mssonicbld

Copy link
Copy Markdown

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

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

## 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>
@mssonicbld

Copy link
Copy Markdown
Author

Original PR: #206

@mssonicbld

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
mssonicbld merged commit ccb5f29 into sonic-net:202605 Jul 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant