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
Reduce verbosity of warnings when remote caching has errors #11740
Merged
Eric-Arellano
merged 3 commits into
pantsbuild:main
from
Eric-Arellano:remoting-logging
Mar 19, 2021
Merged
Reduce verbosity of warnings when remote caching has errors #11740
Eric-Arellano
merged 3 commits into
pantsbuild:main
from
Eric-Arellano:remoting-logging
Mar 19, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
I chose 5 because I get 5 read errors and 18 write errors when using an invalid address and running |
tdyas
approved these changes
Mar 19, 2021
tdyas
reviewed
Mar 19, 2021
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
asherf
approved these changes
Mar 19, 2021
Merged
Eric-Arellano
added a commit
that referenced
this pull request
Apr 8, 2021
…tty (#11859) #11740 added new aggregation of remote cache logs. It was a fine start, but did not work properly for several error messages because we were dumping the headers, which included unique values like timestamps or the digest value: > 23:16:17.28 [WARN] Failed to write to remote cache (1 occurrences so far): Error from server in response to find_missing_blobs_request: Status { code: PermissionDenied, message: "insufficient permissions", metadata: MetadataMap { headers: {"server": "awselb/2.0", "date": "Mon, 05 Apr 2021 23:16:17 GMT", "content-type": "application/grpc", "content-length": "0"} } } Further, these headers were extremely noisy and most users don't care about them. They're now short: > 23:16:17.28 [WARN] Failed to write to remote cache (1 occurrences so far): PermissionDenied: "insufficient permissions" Likewise, for most use cases, it was still too noisy to dump every increment. Our average use case should only log the very first time so that people are aware of the problem, but don't get flooded. In CI, users can set to log more frequently, which is now implemented via exponential backoff based on the exponent of 2. [ci skip-build-wheels]
Eric-Arellano
added a commit
to Eric-Arellano/pants
that referenced
this pull request
Apr 8, 2021
…tty (pantsbuild#11859) pantsbuild#11740 added new aggregation of remote cache logs. It was a fine start, but did not work properly for several error messages because we were dumping the headers, which included unique values like timestamps or the digest value: > 23:16:17.28 [WARN] Failed to write to remote cache (1 occurrences so far): Error from server in response to find_missing_blobs_request: Status { code: PermissionDenied, message: "insufficient permissions", metadata: MetadataMap { headers: {"server": "awselb/2.0", "date": "Mon, 05 Apr 2021 23:16:17 GMT", "content-type": "application/grpc", "content-length": "0"} } } Further, these headers were extremely noisy and most users don't care about them. They're now short: > 23:16:17.28 [WARN] Failed to write to remote cache (1 occurrences so far): PermissionDenied: "insufficient permissions" Likewise, for most use cases, it was still too noisy to dump every increment. Our average use case should only log the very first time so that people are aware of the problem, but don't get flooded. In CI, users can set to log more frequently, which is now implemented via exponential backoff based on the exponent of 2. [ci skip-build-wheels]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #11494. We still always log errors, but only at the warn level for the 1st instance of a particular error, and then every 5 times after that. Otherwise, we use the debug level.
For example:
This intentionally does not add an option to control this behavior, instead trying to reach a sensible default that balances the desire for logs to know when things aren't working with not wanting to crowd the console. Pants arguably has options fatigue, and adding an option here would add lots of complexity (including wiring over FFI).
Note that for simplicity of the implementation, this does not log at warn level the final count of errors, as we do not know what the final call to
run()
will be. Users can use-ldebug
if they care about this, especially with--log-levels-by-target
.[ci skip-build-wheels]