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

split the error message in backend syncer health processing #864

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

freehan
Copy link
Contributor

@freehan freehan commented Sep 24, 2019

In the first sync for an ingress, this log line usually gets emitted:

E0924 13:25:09.946149   83693 l7.go:325] Error syncing backend status for k8s-be-31890--68d8bd3f6b43351f - ga - global: error getting health for backend "k8s-be-31890--68d8bd3f6b43351f": <nil>     

Usually shortly after Backends are attached to Backend-Services, there is no health status. Hence result in the log line.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 24, 2019
@freehan
Copy link
Contributor Author

freehan commented Sep 24, 2019

cc @skmatti

@@ -163,7 +163,7 @@ func (b *Backends) Delete(name string, version meta.Version, scope meta.KeyType)
func (b *Backends) Health(name string, version meta.Version, scope meta.KeyType) (string, error) {
be, err := b.Get(name, version, scope)
if err != nil || len(be.Backends) == 0 {
return "Unknown", fmt.Errorf("error getting health for backend %s: %v", name, err)
return "Unknown", fmt.Errorf("error getting backend %s: %v", name, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

%q. Same below as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@rramkumar1
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 24, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: freehan, rramkumar1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -163,7 +163,7 @@ func (b *Backends) Delete(name string, version meta.Version, scope meta.KeyType)
func (b *Backends) Health(name string, version meta.Version, scope meta.KeyType) (string, error) {
be, err := b.Get(name, version, scope)
if err != nil || len(be.Backends) == 0 {
return "Unknown", fmt.Errorf("error getting health for backend %s: %v", name, err)
return "Unknown", fmt.Errorf("error getting backend %q: %v", name, err)
Copy link
Member

Choose a reason for hiding this comment

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

can we separate out the cases here

if err != nil {
  return "Unknown", fmt.Errorf("error betting backend...", ...)
}
if len(be.Backends) == 0 {
  return "Unknown", fmt.Errorf("backend list is empty...", ...)
}

return "Unknown", fmt.Errorf("error getting health for backend %q: %v", name, err)
}
if len(hs.HealthStatus) == 0 || hs.HealthStatus[0] == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Why would we get a nil in the first element? seems incorrect (somewhere).

@rramkumar1 rramkumar1 removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 24, 2019
@k8s-ci-robot k8s-ci-robot merged commit 6f4fee8 into kubernetes:master Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants