You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "TakaHiR07 (via GitHub)" <gi...@apache.org> on 2025/06/04 08:49:26 UTC

[PR] Fix a NPE bug after refactor recycler of BookieClient [bookkeeper]

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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix a NPE bug after refactor recycler of BookieClient [bookkeeper]

Posted by "StevenLuMT (via GitHub)" <gi...@apache.org>.
StevenLuMT merged PR #4610:
URL: https://github.com/apache/bookkeeper/pull/4610


-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix a NPE bug after refactor recycler of BookieClient [bookkeeper]

Posted by "StevenLuMT (via GitHub)" <gi...@apache.org>.
StevenLuMT commented on PR #4610:
URL: https://github.com/apache/bookkeeper/pull/4610#issuecomment-2964779194

   1. This is based on #4609, so I also added #4609 to `release/4.17.2`
   
   2. kept consistent without introducing new features #4609 to `release/4.16.7`


-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org