Skip to content

FaultManager: Clean up pending_clusters_ when fault is cleared before min_count #127

@mfaferek93

Description

@mfaferek93

Context

Follow-up from #105 (fault correlation engine).

Problem

When a fault is cleared before a pending cluster reaches min_count, the pending_clusters_
map retains a "phantom" reference to the cleared fault code.

Impact

  • Low impact - pending clusters expire after window_ms anyway
  • Could cause brief inconsistency if cluster becomes active with a cleared fault in its list

Proposed Fix

In CorrelationEngine::process_clear():

  1. Iterate through pending_clusters_ (keyed by rule_id)
  2. Remove the cleared fault_code from each pending cluster's fault_codes list
  3. Reassign representative if the cleared fault was the representative

Acceptance Criteria

  • Cleared faults are removed from pending_clusters_
  • Representative is reassigned if needed
  • Unit test covering this scenario

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions