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

Fix npe when iterate pendingLedgersUpdates and pendingDeletedLedgers. #3955

Merged
merged 2 commits into from
May 19, 2023

Conversation

horizonzy
Copy link
Member

Descriptions of the changes in this PR:
Fixes #3954

@@ -300,6 +300,9 @@ public void flush() throws IOException {
int updatedLedgers = 0;
while (!pendingLedgersUpdates.isEmpty()) {
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Make sense.

Copy link
Contributor

@hangc0276 hangc0276 left a comment

Choose a reason for hiding this comment

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

Nice catch!

@horizonzy
Copy link
Member Author

rerun failure checks

Copy link
Member

@wenbingshen wenbingshen left a comment

Choose a reason for hiding this comment

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

Good Catch!

@zymap zymap merged commit a122b6b into apache:master May 19, 2023
16 checks passed
zymap pushed a commit that referenced this pull request Jun 19, 2023
…#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)
hangc0276 pushed a commit to hangc0276/bookkeeper that referenced this pull request Jun 26, 2023
…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)
zymap pushed a commit that referenced this pull request Dec 6, 2023
…#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)
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
…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/:?]
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.

The bookie shutdown due to the pendingLedgersUpdates NPE when checkpoint.
6 participants