Skip to content

Commit

Permalink
Bug fix for inter-node traffic
Browse files Browse the repository at this point in the history
For flows that do not need correlation, ReadyToSend and areCorrelatedFieldsFilled should always be true.

Signed-off-by: Yun-Tang Hsu <[email protected]>
  • Loading branch information
Yun-Tang Hsu committed Dec 15, 2023
1 parent 837050b commit 9d8d3ac
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions pkg/intermediate/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,6 @@ func (a *AggregationProcess) addOrUpdateRecordInMap(flowKey *FlowKey, record ent
waitForReadyToSendRetries: 0,
isIPv4: isIPv4,
}

if !correlationRequired {
aggregationRecord.ReadyToSend = true
// If no correlation is required for an Inter-Node record, K8s metadata is
// expected to be not completely filled. For Intra-Node flows and ToExternal
// flows, areCorrelatedFieldsFilled is set to true by default.
if flowType == registry.FlowTypeInterNode {
aggregationRecord.areCorrelatedFieldsFilled = false
} else {
aggregationRecord.areCorrelatedFieldsFilled = true
}
}
aggregationRecord.areExternalFieldsFilled = false
// Push the record to the priority queue.
pqItem := &ItemToExpire{
Expand All @@ -432,6 +420,11 @@ func (a *AggregationProcess) addOrUpdateRecordInMap(flowKey *FlowKey, record ent
pqItem.inactiveExpireTime = currTime.Add(a.inactiveExpiryTimeout)
heap.Push(&a.expirePriorityQueue, pqItem)
}
// For flows that do not need correlation, ReadyToSend and areCorrelatedFieldsFilled should always be true.
if !correlationRequired {
aggregationRecord.ReadyToSend = true
aggregationRecord.areCorrelatedFieldsFilled = true

Check warning on line 426 in pkg/intermediate/aggregate.go

View check run for this annotation

Codecov / codecov/patch

pkg/intermediate/aggregate.go#L425-L426

Added lines #L425 - L426 were not covered by tests
}
a.flowKeyRecordMap[*flowKey] = aggregationRecord
return nil
}
Expand Down

0 comments on commit 9d8d3ac

Please sign in to comment.