-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Limit the log line length for s3 deletion error #123953
Limit the log line length for s3 deletion error #123953
Conversation
If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string to a length of 1000 characters. Relates: elastic#123630
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes fair point LGTM
() -> format( | ||
"Failed to delete some blobs %s", | ||
e.getErrors() | ||
logger.warn(() -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it makes sense to not spit out all of the blob names. But two nits: could we instead just pick the first N items rather than truncating it like this? Also since this is a WARN for an error case, having the runnable for the logger isn't really helping much, just makes it harder to read, IMO. Can we pull that out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushe 5d67feb which should address both suggestions. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw the usage of Strings.collectionToDelimitedStringWithLimit
was modelled after this. It might be worthwhile to extract a new common method for both as well.
@elasticmachine update branch |
💔 Backport failed
You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string length to first 10 entries. Relates: elastic#123630 (cherry picked from commit a9432ba) # Conflicts: # modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobStore.java # modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobContainerRetriesTests.java
) * Limit the log line length for s3 deletion error (#123953) If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string length to first 10 entries. Relates: #123630 (cherry picked from commit a9432ba) # Conflicts: # modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3BlobStore.java # modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobContainerRetriesTests.java * fix backport
If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string length to first 10 entries. Relates: elastic#123630
If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string length to first 10 entries. Relates: elastic#123630
If all items fail to delete, the current warning log builds a huge string to include all of them (up to 1000). This PR limits the string length to first 10 entries.
Relates: #123630