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

Deduplicate cause if already contained in shard failures #14432

Merged
merged 1 commit into from Nov 3, 2015

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Nov 2, 2015

If we have a shard failure on SearchPhaseExecutionException
we can deduplicate the original cause and use the more informative
ShardSearchFailure containing the shard ID etc. but we should deduplicate
the actual cause to prevent stack trace duplication.

@s1monw s1monw force-pushed the add_shard_failure_as_suppressed branch from 9504a17 to 905bbea Compare November 2, 2015 10:22
@s1monw s1monw changed the title Add ShardSearchFailure as suppressed to not loose original stacktrace Deduplicate cause if already contained in shard failures Nov 2, 2015
@javanna
Copy link
Member

javanna commented Nov 2, 2015

LGTM

throw new IllegalArgumentException("shardSearchFailures must not be null");
}
// if the cause of this exception is also the cause of one of the shard failures we don't add it
// to prevent duplication in stack traces rendered to the REST layer
Copy link
Contributor

Choose a reason for hiding this comment

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

if the issue is the rest layer, should we instead:

  • keep the cause as-is
  • at serialization time, add a magic number when serializing shard failures if they are the same as the cause of the top-level exception and deserialize by copying the cause
  • at rendering time (toxcontent) not render stack traces of shard failures if they are the same as the top-level exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if it's relevant.... what I wanted there is to add a cause always to this exception which wasn't the case. if we do that we don't need to add it if we have it as a shard failure already since we override getCause so it's equivalent.

If we have a shard failure on SearchPhaseExecutionException
we can deduplicate the original cause and use the more informative
ShardSearchFailure containing the shard ID etc. but we should deduplicate
the actual cause to prevent stack trace duplication.
@s1monw s1monw force-pushed the add_shard_failure_as_suppressed branch from ca17498 to 3f94a56 Compare November 3, 2015 10:35
@jpountz
Copy link
Contributor

jpountz commented Nov 3, 2015

OK, I had missed that this exception overrides getCause(). LGTM

s1monw added a commit that referenced this pull request Nov 3, 2015
Deduplicate cause if already contained in shard failures
@s1monw s1monw merged commit d76ae67 into elastic:master Nov 3, 2015
@s1monw s1monw deleted the add_shard_failure_as_suppressed branch November 3, 2015 11:06
@lcawl lcawl added :Core/Infra/Core Core issues without another label and removed :Exceptions labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants