Skip to content

Commit

Permalink
Wait for 5 seconds when getting of_port number
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
antoninbas committed Jun 15, 2020
1 parent e77a28a commit cd225e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/ovs/ovsconfig/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions pkg/ovs/ovsconfig/default_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cd225e1

Please sign in to comment.