pasha-kuznetsov opened a new pull request #868: ISSUE #863: BK client error 
messages needs to be more descriptive
URL: https://github.com/apache/bookkeeper/pull/868
 
 
   This improves logging of error codes as described in the issue #863. I only 
addressed the most glaring cases where bare `rc` was logged by introducing a 
new logging utility which can be used as follows:
   ```
   LOG.error("Closing ledger {} due to {}", ledgerId, 
BKException.codeLogger(rc));
   ```
   producing messages similar to the following:
   ```
   2017-12-15 17:01:11,602 - ERROR - 
[Builder-OrderedSafeExecutor-1-0:LedgerHandle@1398] - 
   Closing ledger 1 due to LedgerFencedException: 
   Ledger has been fenced off. Some other client must have opened it to read
   ```
   
   We can also discuss if the cases similar to the following should be brought 
in line with the above changes, which produces more information compared to the 
new approach, including stack trace, although not the original one:
   ```
   if (rc != BKException.Code.OK) {
       LOG.error("BK error opening ledger: " + lId, BKException.create(rc)); // 
<------------------
       finalLedgerIterCb.processResult(rc, null, null);
       return;
   }
   ```
   
   P.S. Please also note that we (Salesforce) are starting to add commit tags 
simplifying our merge process, e.g. `(@bug W-3843968@)` -- please let us know 
if that is a big issue which needs to be discussed separately.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to