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

Don't catch FNF/NSF exception when reading metadata #8207

Merged
merged 1 commit into from
Oct 24, 2014

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Oct 23, 2014

When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

@s1monw s1monw changed the title [STORE] Rethrow FNF exception if commit-point is provided [STORE] Don't catch FNF/NSF exception when reading metadata Oct 23, 2014
@s1monw
Copy link
Contributor Author

s1monw commented Oct 23, 2014

@bleskes can you take a look at this please?

/**
* Returns a new MetadataSnapshot for the latest commit in this store or
* an empty snapshot if no index exists or can not be opened
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's good to explicitly mention that this may throw an IndexCorruptedException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

@bleskes
Copy link
Contributor

bleskes commented Oct 24, 2014

LGTM. Left two minor comments.

@s1monw
Copy link
Contributor Author

s1monw commented Oct 24, 2014

@bleskes pushed a new commit

@bleskes
Copy link
Contributor

bleskes commented Oct 24, 2014

looks great. Thx @s1monw

When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes elastic#8207
@s1monw s1monw removed the review label Oct 24, 2014
@s1monw s1monw merged commit c09af6d into elastic:master Oct 24, 2014
s1monw added a commit that referenced this pull request Oct 24, 2014
When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes #8207
s1monw added a commit that referenced this pull request Oct 24, 2014
When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes #8207
s1monw added a commit that referenced this pull request Oct 24, 2014
When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes #8207
@clintongormley clintongormley changed the title [STORE] Don't catch FNF/NSF exception when reading metadata Resiliency: Don't catch FNF/NSF exception when reading metadata Nov 3, 2014
@clintongormley clintongormley added the :Core/Infra/Core Core issues without another label label Mar 19, 2015
@clintongormley clintongormley changed the title Resiliency: Don't catch FNF/NSF exception when reading metadata Don't catch FNF/NSF exception when reading metadata Jun 7, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes elastic#8207
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
When reading metadata we do catch FileNotFound and NoSuchFileExceptions
today, log the even and return an empty metadata object. Yet, in some cases
this might be the wrong thing todo ie. if a commit point is provided these
situations are actually an error and should be rethrown. This commit
pushes the responsiblity to the caller to handle this exception.

Closes elastic#8207
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.

3 participants