Skip to content

Commit

Permalink
Fix Traceflow IPv6 DS e2e error
Browse files Browse the repository at this point in the history
  • Loading branch information
gran-vmv committed Apr 26, 2021
1 parent 3335e73 commit 46f6e72
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/agent/controller/traceflow/traceflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ const (
maxRetryDelay = 300 * time.Second
// Default number of workers processing traceflow request.
defaultWorkers = 4
// Seconds delay before injecting packet into OVS. The time of different nodes may not be completely
// Delay in milliseconds before injecting packet into OVS. The time of different nodes may not be completely
// synchronized, which requires a delay before inject packet.
injectPacketDelay = 5
injectPacketDelay = 2000
injectLocalPacketDelay = 100

// ICMP Echo Request type and code.
icmpEchoRequestType uint8 = 8
Expand Down Expand Up @@ -365,7 +366,11 @@ func (c *Controller) startTraceflow(tf *crdv1alpha1.Traceflow) error {
// If the destination is Service/IP or the packet will
// be sent to remote Node, wait a small period for other
// Nodes.
time.Sleep(time.Duration(injectPacketDelay) * time.Second)
time.Sleep(time.Duration(injectPacketDelay) * time.Millisecond)
} else {
// Issue #2116
// Wait a small period after flows installed to avoid unexpected behavior.
time.Sleep(time.Duration(injectLocalPacketDelay) * time.Millisecond)
}
klog.V(2).Infof("Injecting packet for Traceflow %s", tf.Name)
err = c.ofClient.SendTraceflowPacket(tfState.tag, packet, ofPort, -1)
Expand Down

0 comments on commit 46f6e72

Please sign in to comment.