Skip to content

Commit

Permalink
Merge pull request #64180 from feiskyer/verbose
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 63434, 64172, 63975, 64180, 63755). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Check SessionAffinity for Azure load balancer

**What this PR does / why we need it**:

Currently azure load balance rule comparing is based on name which does not have affinity information. So during updating, the loadDistribution property is not updated.

This PR fixes this and adds some verbose logs for better understanding what's happening.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #63908

**Special notes for your reviewer**:

Cherry pick to 1.10.

**Release note**:

```release-note
Fix SessionAffinity not updated issue for Azure load balancer
```
  • Loading branch information
Kubernetes Submit Queue committed May 24, 2018
2 parents b8dff0b + a50ac29 commit 2feb093
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 64 deletions.
14 changes: 7 additions & 7 deletions pkg/cloudprovider/providers/azure/azure_backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.Virtua
return true, cloudprovider.InstanceNotFound
}
if retryErr != nil {
glog.Errorf("backoff: failure, will retry,err=%v", retryErr)
glog.Errorf("GetVirtualMachineWithRetry(%s): backoff failure, will retry, err=%v", name, retryErr)
return false, nil
}
glog.V(2).Info("backoff: success")
glog.V(2).Infof("GetVirtualMachineWithRetry(%s): backoff success", name)
return true, nil
})
if err == wait.ErrWaitTimeout {
Expand Down Expand Up @@ -99,10 +99,10 @@ func (az *Cloud) GetIPForMachineWithRetry(name types.NodeName) (string, string,
var retryErr error
ip, publicIP, retryErr = az.getIPForMachine(name)
if retryErr != nil {
glog.Errorf("backoff: failure, will retry,err=%v", retryErr)
glog.Errorf("GetIPForMachineWithRetry(%s): backoff failure, will retry,err=%v", name, retryErr)
return false, nil
}
glog.V(2).Info("backoff: success")
glog.V(2).Infof("GetIPForMachineWithRetry(%s): backoff success", name)
return true, nil
})
return ip, publicIP, err
Expand Down Expand Up @@ -304,11 +304,11 @@ func (az *Cloud) UpdateVmssVMWithRetry(ctx context.Context, resourceGroupName st
// A wait.ConditionFunc function to deal with common HTTP backoff response conditions
func processRetryResponse(resp autorest.Response, err error) (bool, error) {
if isSuccessHTTPResponse(resp) {
glog.V(2).Infof("backoff: success, HTTP response=%d", resp.StatusCode)
glog.V(2).Infof("processRetryResponse: backoff success, HTTP response=%d", resp.StatusCode)
return true, nil
}
if shouldRetryAPIRequest(resp, err) {
glog.Errorf("backoff: failure, will retry, HTTP response=%d, err=%v", resp.StatusCode, err)
glog.Errorf("processRetryResponse: backoff failure, will retry, HTTP response=%d, err=%v", resp.StatusCode, err)
// suppress the error object so that backoff process continues
return false, nil
}
Expand Down Expand Up @@ -361,7 +361,7 @@ func processHTTPRetryResponse(resp *http.Response, err error) (bool, error) {
}

if shouldRetryHTTPRequest(resp, err) {
glog.Errorf("backoff: failure, will retry, HTTP response=%d, err=%v", resp.StatusCode, err)
glog.Errorf("processHTTPRetryResponse: backoff failure, will retry, HTTP response=%d, err=%v", resp.StatusCode, err)
// suppress the error object so that backoff process continues
return false, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudprovider/providers/azure/azure_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (az *Cloud) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.N
addressGetter := func(nodeName types.NodeName) ([]v1.NodeAddress, error) {
ip, publicIP, err := az.GetIPForMachineWithRetry(nodeName)
if err != nil {
glog.V(2).Infof("NodeAddresses(%s) abort backoff", nodeName)
glog.V(2).Infof("NodeAddresses(%s) abort backoff: %v", nodeName, err)
return nil, err
}

Expand Down
Loading

0 comments on commit 2feb093

Please sign in to comment.