Skip to content

Conversation

@prdoyle
Copy link
Contributor

@prdoyle prdoyle commented Jan 30, 2025

ReservedClusterStateService sometimes throws an IllegalArgumentException with a huge description field containing a complete stack trace, like here, where it includes an ErrorState in the description, and ErrorState includes the stack trace:

this(namespace, version, versionCheck, List.of(stackTrace(e)), errorKind);

The solution here is just to limit the length of the description. I've used a Setting in case the default length limit turns out to be too short and it needs to be overridden in a hurry (ironically, using FileSettingsService).

See ES-10713.

@prdoyle prdoyle requested a review from a team as a code owner January 30, 2025 21:04
@prdoyle prdoyle self-assigned this Jan 30, 2025
@prdoyle prdoyle added >non-issue :Core/Infra/Core Core issues without another label v9.1.0 labels Jan 30, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Jan 30, 2025
@elasticsearchmachine
Copy link
Collaborator

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) + "…";
Copy link
Contributor Author

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.

Copy link
Contributor

@JVerwolf JVerwolf left a 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.

@prdoyle prdoyle enabled auto-merge (squash) January 31, 2025 18:12
@prdoyle prdoyle merged commit 0698d73 into elastic:main Jan 31, 2025
17 checks passed
@prdoyle prdoyle deleted the limit-description-length branch January 31, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants