Skip to content

Commit

Permalink
increase backoff time when updating loadbalancer pool member
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaab committed Jun 22, 2022
1 parent ab73ddf commit a12cc96
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion upup/pkg/fi/cloudup/openstack/loadbalancer.go
Expand Up @@ -18,6 +18,7 @@ package openstack

import (
"fmt"
"time"

"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
Expand All @@ -30,6 +31,14 @@ import (
"k8s.io/kops/util/pkg/vfs"
)

// memberBackoff is the backoff strategy for openstack updating members in loadbalancer pool
var memberBackoff = wait.Backoff{
Duration: time.Second,
Factor: 2,
Jitter: 0.1,
Steps: 10,
}

func (c *openstackCloud) CreatePoolMonitor(opts monitors.CreateOpts) (*monitors.Monitor, error) {
return createPoolMonitor(c, opts)
}
Expand Down Expand Up @@ -361,7 +370,7 @@ func updateMemberInPool(c OpenstackCloud, poolID string, memberID string, opts v
return nil, fmt.Errorf("loadbalancer support not available in this deployment")
}

done, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {
done, err := vfs.RetryWithBackoff(memberBackoff, func() (bool, error) {
association, err = v2pools.UpdateMember(c.LoadBalancerClient(), poolID, memberID, opts).Extract()
if err != nil {
// member not found anymore
Expand Down

0 comments on commit a12cc96

Please sign in to comment.