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

Logging what really caused lookup failure #450

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

wuYin
Copy link
Contributor

@wuYin wuYin commented Jan 25, 2021

Motivation

Clusters deployed over k8s, during broker pod restarting / terminating, it's service DNS .cluster.local will be removed, cause proxy can't resolve the restarting owner broker DNS name.
For now, client only logging ServiceNotReady error but without details which help troubleshoot.

Modifications

Logging LookupResponse failure detail message, like this:

image

Verifying this change

  • Make sure that the change passes the CI checks.

}
ls.log.Warnf("Failed to lookup topic: %s, error msg: %s", topic, errorMsg)
return nil, fmt.Errorf("failed to lookup topic: %s", errorMsg)
err := fmt.Errorf("failed to lookup topic: %s, error: %s, message: %s", topic, lr.GetError(), lr.GetMessage())
Copy link
Contributor

Choose a reason for hiding this comment

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

We should preferably use the WithField("error", lr.getGetError()) instead of formatting into a string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for review, I'll follow this convention
Now I removed string formatting, message fields will be highlight in log and only print once

@merlimat merlimat merged commit a1dca8c into apache:master Jan 25, 2021
@merlimat merlimat added this to the 0.4.0 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants