You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: KeyError when using mode: combine in TrafficMatrixPlacement with context caching #96
Any scenario with a traffic matrix using mode: combine:
traffic_matrix_set:
example:
- source_path: region1/.*/rbsink_path: region2/.*/rbdemand: 100000mode: combine # <-- triggers the bugRoot CauseIn ngraph/exec/analysis/flow.py, both build_demand_context() and demand_placement_analysis() reconstruct TrafficDemand objects from serialized config but fail to pass the id field:
demand = TrafficDemand(source_path=config["source_path"],sink_path=config["sink_path"],demand=config["demand"],mode=config.get("mode", "pairwise"),flow_policy_config=config.get("flow_policy_config"),priority=config.get("priority", 0),# id=config.get("id"), <-- MISSING)When mode: combine is used, pseudo-nodes are named using TrafficDemand.id (e.g., _src_{td.id}). Without preserving the ID, each reconstruction generates a new random UUID, causing pseudo-node name mismatchesbetween the cached context and the analysis phase.FixAdd id=config.get("id") to TrafficDemand construction in both:
- demand_placement_analysis() (line ~187)
- build_demand_context() (line ~433)Testing GapThis bug slipped through because:
1. No tests for mode: combine + context caching - The bug only occurs when both conditions are met2. No TrafficMatrixPlacement integration test with mode: combine - Workflow tests likely only use mode: pairwise3. No ID round-trip validation - No test verifies TrafficDemand.id survives serialization/deserializationSuggested Test Coverage| Test Type | Description ||-------------|-------------------------------------------------------------------|| Unit | TrafficDemand.id preserved through dict serialization round-trip || Integration | demand_placement_analysis() with cached context and mode: combine || E2E | TrafficMatrixPlacement step with mode: combine traffic matrix |
Activity