Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Traceflow IPv6 DualStack e2e error #2114

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the comment which says the unit is seconds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And perhaps "Delay in milliseconds before ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will fix here.

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