-
Notifications
You must be signed in to change notification settings - Fork 275
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
Fix NullPointerException and 'no more capacity' issues in blob store #1168
Conversation
Thanks for fixing it! |
Codecov Report
@@ Coverage Diff @@
## master #1168 +/- ##
============================================
- Coverage 70.03% 69.89% -0.14%
+ Complexity 5352 5347 -5
============================================
Files 426 426
Lines 32650 32654 +4
Branches 4142 4143 +1
============================================
- Hits 22865 22825 -40
- Misses 8653 8686 +33
- Partials 1132 1143 +11
Continue to review full report at Codecov.
|
@@ -906,8 +908,8 @@ private void readFromFile(File fileToRead, Journal journal) throws StoreExceptio | |||
StoreErrorCodes.Index_Creation_Failure); | |||
} | |||
} catch (IOException e) { | |||
StoreErrorCodes errorCode = | |||
e.getMessage().equals(StoreException.IO_ERROR_STR) ? StoreErrorCodes.IOError : StoreErrorCodes.Unknown_Error; | |||
StoreErrorCodes errorCode = Objects.equals(e.getMessage(), StoreException.IO_ERROR_STR) ? StoreErrorCodes.IOError |
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.
The logic for going from IOException to StoreErrorCode is repeated in a lot of places. Since this is a bugfix, you don't have to address it now, but it would be good to move this into a static method in StoreException in the future.
1. NPE occurs when error message of captured IOException is null. In this case, we should use Objects.equals to compare error string. 2. 'no more capacity' issue occurs when new log segment creation failed, however, the code didn't restore the counter of remainingUnallocatedSegments. This patch will catch such failure and restore counter as well as clean up the allocted file.
this case, we should use Objects.equals to compare error string.
however, the code didn't restore the counter of remainingUnallocatedSegments.
This patch will catch such failure and restore counter as well as clean
up the allocated file.
This pr will address #1167