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. 
   
   
   
![企业微信截图_c8eea33b-7b52-49dc-8179-1f9f25fc35d1](https://github.com/user-attachments/assets/76391b1c-09c0-417e-ac98-afeb31441022)
   
   
   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]

Reply via email to