TakaHiR07 opened a new pull request, #4610: URL: https://github.com/apache/bookkeeper/pull/4610
### Motivation After test for a few days in cluster, there is a NPE bug after refactor recycler of bookieClient.  In CompletionValue#timeout(), it would do errorOut() and then register latency in timeoutOpLogger. But errorOut() would trigger writeComplete() and then recycle the completionValue object. So the timeoutOpLogger is also recycle and throw NPE. ### Changes change the execute order: register latency first and then do errorOut(). Alternative fix is like: ``` void timeout() { OpStatsLogger logger = timeoutOpLogger; errorOut(BKException.Code.TimeoutException); logger.registerSuccessfulEvent(latency(), TimeUnit.NANOSECONDS); } ``` But I think it is unnecessary to record the errorOut() time in prometheus, because this time cost has no influence of this timeout metric. -- 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]
