From 7024c2a7b2aab0db4d6ef8cd194bc1a029aa12e3 Mon Sep 17 00:00:00 2001 From: Antonin Bas Date: Thu, 11 Jun 2020 17:20:01 -0700 Subject: [PATCH] Wait for 5 seconds when getting of_port number Instead of 1 second on Linux. We have observed on some production clusters that it sometimes takes more second for ovs-vswitch to report the port number to OVSDB, although we are not yet sure why. Because the wait operation actually returns when the port is available, this does not increase execution time of CNI Add in the general case. --- pkg/ovs/ovsconfig/default.go | 4 ++-- pkg/ovs/ovsconfig/default_windows.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/ovs/ovsconfig/default.go b/pkg/ovs/ovsconfig/default.go index b2f25106b64..94a6a898fac 100644 --- a/pkg/ovs/ovsconfig/default.go +++ b/pkg/ovs/ovsconfig/default.go @@ -25,8 +25,8 @@ const ( DefaultOVSRunDir = "/var/run/openvswitch" defaultConnNetwork = "unix" - // Wait up to 1 second when get port. - defaultGetPortTimeout = 1 * time.Second + // Wait up to 5 seconds when getting port. + defaultGetPortTimeout = 5 * time.Second ) func GetConnAddress(ovsRunDir string) string { diff --git a/pkg/ovs/ovsconfig/default_windows.go b/pkg/ovs/ovsconfig/default_windows.go index 016582dded6..1ca441e8bdf 100644 --- a/pkg/ovs/ovsconfig/default_windows.go +++ b/pkg/ovs/ovsconfig/default_windows.go @@ -25,9 +25,8 @@ const ( defaultConnNetwork = "winpipe" namedPipePrefix = `\\.\pipe\` - // Wait up to 2 seconds when get port, the operation of port creation - // takes longer on Windows platform than on Linux. - defaultGetPortTimeout = 2 * time.Second + // Wait up to 5 seconds when getting port. + defaultGetPortTimeout = 5 * time.Second ) func GetConnAddress(ovsRunDir string) string {