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

server+discovery: Only log errors if request was not cancelled #1837

Merged
merged 3 commits into from
May 18, 2021

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Apr 11, 2021

What does this pull request do? Explain your changes. (required)

Specific updates (required)

  • Wrap discovery related errors in the server package instead of concatenating the error message strings. This allows usage of errors.Is() because it can now unwrap error messages.
  • Add a check to see if an error from discovery doesn't contain context.Canceled or context.Exceeded and only log the error if it doesn't

How did you test each of these updates (required)
Ran a broadcaster on rinkeby

Does this pull request close any open issues?
Fixes #1846

Checklist:

@@ -85,8 +86,11 @@ func (o *orchestratorPool) GetOrchestrators(numOrchestrators int, suspender comm
infoCh <- info
return
}
if err != nil && monitor.Enabled {
monitor.LogDiscoveryError(err.Error())
if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should still log an error if the error wraps a context.DeadlineExceeded as that would indicate a timeout with the O which still feels useful to be aware of as it tells us the O could not respond within the timeout while a context.Cancelled (and empirically, the majority of excessive logging on mainnet for Bs seems to be from context.Cancelled) is always B initiated and doesn't really tell us anything about O's ability to respond. WDYT?

Copy link
Contributor

@kyriediculous kyriediculous May 18, 2021

Choose a reason for hiding this comment

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

Fixed and rebased, will approve when CI passes.

@kyriediculous
Copy link
Contributor

I just updated the commit message and force pushed (removed "deadline exceeded" bit) , CI already passed before this so I think iit should be okay to merge.

@kyriediculous kyriediculous merged commit c14af11 into master May 18, 2021
@kyriediculous kyriediculous deleted the yf/discovery-logging branch May 18, 2021 18:39
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.

Silence discovery error logs if the request is cancelled
2 participants