-
Notifications
You must be signed in to change notification settings - Fork 895
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 npe when iterate pendingLedgersUpdates and pendingDeletedLedgers. #3955
Conversation
@@ -300,6 +300,9 @@ public void flush() throws IOException { | |||
int updatedLedgers = 0; | |||
while (!pendingLedgersUpdates.isEmpty()) { |
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.
If this method is not thread-safe, perhaps we could use the poll
method and determine if it is null
to implement loop control.
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.
Make sense.
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.
Nice catch!
rerun failure checks |
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.
Good Catch!
…#3955) Descriptions of the changes in this PR: Fixes #3954 2023-05-12T16:58:26,212 - INFO - [db-storage-cleanup-5-1:EntryLocationIndex@244] - Deleted indexes from 10 ledgers in 0.006 seconds 2023-05-12T16:58:26,203 - ERROR - [SyncThread-7-1:SyncThread@111] - Exception in SyncThread java.lang.NullPointerException: null at org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex.flush(LedgerMetadataIndex.java:303) ~[classes/:?] (cherry picked from commit a122b6b)
…apache#3955) Descriptions of the changes in this PR: Fixes apache#3954 2023-05-12T16:58:26,212 - INFO - [db-storage-cleanup-5-1:EntryLocationIndex@244] - Deleted indexes from 10 ledgers in 0.006 seconds 2023-05-12T16:58:26,203 - ERROR - [SyncThread-7-1:SyncThread@111] - Exception in SyncThread java.lang.NullPointerException: null at org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex.flush(LedgerMetadataIndex.java:303) ~[classes/:?] (cherry picked from commit a122b6b)
…#3955) Descriptions of the changes in this PR: Fixes #3954 2023-05-12T16:58:26,212 - INFO - [db-storage-cleanup-5-1:EntryLocationIndex@244] - Deleted indexes from 10 ledgers in 0.006 seconds 2023-05-12T16:58:26,203 - ERROR - [SyncThread-7-1:SyncThread@111] - Exception in SyncThread java.lang.NullPointerException: null at org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex.flush(LedgerMetadataIndex.java:303) ~[classes/:?] (cherry picked from commit a122b6b)
…apache#3955) Descriptions of the changes in this PR: Fixes apache#3954 2023-05-12T16:58:26,212 - INFO - [db-storage-cleanup-5-1:EntryLocationIndex@244] - Deleted indexes from 10 ledgers in 0.006 seconds 2023-05-12T16:58:26,203 - ERROR - [SyncThread-7-1:SyncThread@111] - Exception in SyncThread java.lang.NullPointerException: null at org.apache.bookkeeper.bookie.storage.ldb.LedgerMetadataIndex.flush(LedgerMetadataIndex.java:303) ~[classes/:?]
Descriptions of the changes in this PR:
Fixes #3954