-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add length limit FileSettingsHealthIndicatorService.description #121334
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
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
| private String limitLength(String description) { | ||
| int descriptionLengthLimit = DESCRIPTION_LENGTH_LIMIT.get(settings); | ||
| if (description.length() > descriptionLengthLimit) { | ||
| return description.substring(0, descriptionLengthLimit - 1) + "…"; |
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.
Note that this is an ellipsis character, not three periods.
JVerwolf
left a comment
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.
Overall LGTM. Had a few questions/thoughts to optionally address.
ReservedClusterStateServicesometimes throws anIllegalArgumentExceptionwith a hugedescriptionfield containing a complete stack trace, like here, where it includes anErrorStatein the description, andErrorStateincludes the stack trace:The solution here is just to limit the length of the description. I've used a
Settingin case the default length limit turns out to be too short and it needs to be overridden in a hurry (ironically, usingFileSettingsService).See ES-10713.