zhaohaidao opened a new issue, #3618:
URL: https://github.com/apache/bookkeeper/issues/3618

   **BUG REPORT**
   NPE throwed when recovering ledger: Cannot read field "distributionSchedule" 
because "this.lh" is null
   ***Describe the bug***
   
   A clear and concise description of what the bug is.
   During LedgerRecovery, the safeRun method of AddPendingOp will be executed. 
When handling failed bookies, bk client will try to replace failed bookies with 
healthy ones. However, if a NotEnoughBookieException occurred when replacing 
bookies , the corresponding AddPendingOp instance will be recycled. Then bad 
things happened as the following logic includes field call on null object.
   <img width="1051" alt="image" 
src="https://user-images.githubusercontent.com/6216286/200281434-117fae3a-5c15-47e5-85f5-45f6e11dbb90.png";>
   
   
   ***To Reproduce***
   
   Steps to reproduce the behavior:
   The reproduce details can be seen in 
PendingAddOpTest#testReadOnlyLedgerHandleWithNotEnoughBookiesExceptionDuringRecoveryAdd
   1. Create a ReadOnlyLedgerHandle instance and a PendingAddOp instance
   2. Make sure  NotEnoughBookiesException throwed during replace bookie process
   3. Execute the safeRun method of the PendingAddOp instance
   
   
   ***Expected behavior***
   NPE throwed and the error log is as followed, just the same as the issue 
title desrcibes
   
   > java.lang.NullPointerException: Cannot read field "distributionSchedule" 
because "this.lh" is null
   
   ***Screenshots***
   <img width="1393" alt="image" 
src="https://user-images.githubusercontent.com/6216286/200280874-e36f3f2a-5dd7-4a8a-8120-1c15130b0318.png";>
   
   If applicable, add screenshots to help explain your problem.
   
   ***Additional context***
   
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to