zhaohaidao commented on PR #3620: URL: https://github.com/apache/bookkeeper/pull/3620#issuecomment-1312667575
> @zhaohaidao Thanks for your contribution. > > The root cause of this NPE is the different implementations of `handleBookieFailure` in `LedgerHandle` and `ReadOnlyLedgerHandle`. > > In the `LedgerHandle` implementation, it handles ensemble change results in a new task with the same thread > > https://github.com/apache/bookkeeper/blob/43bdfb35317d9a69840d17df94c5c801a4cbba62/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java#L1962-L2004 > > In the `ReadOnlyLedgerHandle`, it handles the ensemble change results and exceptions in the current task and current thread, which will lead to the NPE. > > https://github.com/apache/bookkeeper/blob/43bdfb35317d9a69840d17df94c5c801a4cbba62/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ReadOnlyLedgerHandle.java#L232 > > I suggest keeping the same with `LedgerHandle` implementation to change `handleUnrecoverableErrorDuringAdd(e.getCode());` to `executeOrdered(() -> handleUnrecoverableErrorDuringAdd(e.getCode()));` Thanks a lot for your explanation. I submitted a revision based on your suggestions. Please have a look if you have time. @hangc0276 -- 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]
