Skip to content

Commit

Permalink
[improve][broker] Add a message to a NullPointerException created in …
Browse files Browse the repository at this point in the history
…ManagedLedgerImpl

- a NPE with no description is confusing

Seeing this in logs of org.apache.pulsar.client.api.SubscriptionMessageDispatchThrottlingTest#testMultiLevelDispatch

2022-08-26T11:18:10,532 - ERROR - [broker-topic-workers-OrderedExecutor-3-0:SafeRunnable@38] - Unexpected throwable caught
java.lang.NullPointerException: null
  • Loading branch information
lhotari authored and Technoboy- committed Aug 31, 2022
1 parent 7dd2c79 commit 3065181
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3439,7 +3439,7 @@ public PositionImpl getNextValidPositionInternal(final PositionImpl position) {
while (!isValidPosition(nextPosition)) {
Long nextLedgerId = ledgers.ceilingKey(nextPosition.getLedgerId() + 1);
if (nextLedgerId == null) {
throw new NullPointerException();
throw new NullPointerException("nextLedgerId is null. No valid next position after " + position);
}
nextPosition = PositionImpl.get(nextLedgerId, 0);
}
Expand Down

0 comments on commit 3065181

Please sign in to comment.