-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Conversation
6115fa7
to
ab54186
Compare
@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 | ||
*/ |
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.
I think it's good to explicitly mention that this may throw an IndexCorruptedException
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.
will do
LGTM. Left two minor comments. |
@bleskes pushed a new commit |
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
9a29a4b
to
c09af6d
Compare
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
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
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
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
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
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.