-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Issue:5669] Fix the ledgerID not found cause NPE #5809
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
Conversation
Signed-off-by: xiaolong.ran <rxl@apache.org>
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
|
@wolfstudy The way to fix it is right. Please help resolve sijie's comments |
Signed-off-by: xiaolong.ran <rxl@apache.org>
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: xiaolong.ran <rxl@apache.org>
|
run integration tests |
|
@sijie @codelipenghui PTAL |
|
run integration tests |
|
run integration tests |
|
ping @sijie PTAL |
|
run integration tests |
|
run java8 tests |
run java8 tests |
run java8 tests |
|
run java8 tests |
1 similar comment
|
run java8 tests |
run java8 tests |
|
run java8 tests |
|
run java8 tests |
run java8 tests |
## Motivation when ledgers.ceilingKey return a NULL value, we need to process the ledgerId is NUll case. ## Modifications change long ledgerId to Long ledgerId and check if ledgerId is NULL.
| PositionImpl startReadOperationOnLedger(PositionImpl position) { | ||
| long ledgerId = ledgers.ceilingKey(position.getLedgerId()); | ||
| PositionImpl startReadOperationOnLedger(PositionImpl position, OpReadEntry opReadEntry) { | ||
| Long ledgerId = ledgers.ceilingKey(position.getLedgerId()); |
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 change maybe not fix npe, it will cause new npe problem.
see this pr line_1800. if ledgerId is null, unbox will cause npe. And opReadEntry callback didn't put ctx, the callback process need use it, npe again.
Signed-off-by: xiaolong.ran rxl@apache.org
Fixes #5669
Motivation
when
ledgers.ceilingKeyreturn a NULL value, we need to process theledgerIdis NUll case.Modifications
long ledgerIdtoLong ledgerIdand check ifledgerIdis NULL.