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

Prevent losing stacktraces when exceptions occur #13587

Merged
merged 1 commit into from
Sep 15, 2015

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Sep 15, 2015

This commit removes unnecesssary use of ExceptionHelpers where we actually
should serialize / deserialize the actual exception. This commit also
fixes one of the oddest problems where the actual exception was never
rendered / printed if all shards failed due to a missing cause.

This commit unfortunately doesn't fix Snapshot/Restore which is almost
unfixable since it has to serialize XContent and read from it which can't
transport exceptions.

@nik9000
Copy link
Member

nik9000 commented Sep 15, 2015

s/loosing/losing/ ?

@s1monw s1monw changed the title Prevent loosing stacktraces when exceptions occur Prevent losing stacktraces when exceptions occur Sep 15, 2015
@rjernst
Copy link
Member

rjernst commented Sep 15, 2015

LGTM.

private static final int VERSION = VERSION_STACK_TRACE;
private static final String CORRUPTED = "corrupted_";
static final String CODEC = "store";
static final int VERSION_WRITE_THROWABLE= 2; // we write throwable since 3.0
Copy link
Member

Choose a reason for hiding this comment

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

s/3.0/2.0/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I wasn't sure yet :)

This commit removes unnecesssary use of ExceptionHelpers where we actually
should serialize / deserialize the actual exception. This commit also
fixes one of the oddest problems where the actual exception was never
rendered / printed if `all shards failed` due to a missing cause.

This commit unfortunately doesn't fix Snapshot/Restore which is almost
unfixable since it has to serialize XContent and read from it which can't
transport exceptions.
@s1monw s1monw merged commit bfa984e into elastic:master Sep 15, 2015
@s1monw
Copy link
Contributor Author

s1monw commented Sep 15, 2015

I will give this some time before I backport

@s1monw
Copy link
Contributor Author

s1monw commented Sep 23, 2015

this has been backported to 2.x in 7d2cff1 and 2.0 in f09f851

@s1monw s1monw deleted the fix_most_exceptions branch September 23, 2015 10:33
@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
Labels
>bug :Core/Infra/Core Core issues without another label v2.0.0-rc1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants