You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/08/30 18:14:04 UTC

[GitHub] sijie commented on issue #1638: Open ledger returns no ledger exception if ledger id is negative

sijie commented on issue #1638: Open ledger returns no ledger exception if ledger id is negative
URL: https://github.com/apache/bookkeeper/pull/1638#issuecomment-417416648
 
 
   @codingwangqi good catch. I think some discussions are required for this line.
   
   @eolivelli I was actually looking into the the implementation. it seems that we treat every validation failure as 'NoSuchLedgerException'. It seems to be a problem to me, because if someone drops some other validation logic in `validate`, it will still be treated as `NoSuchLedgerException`, then it becomes wrong.
   
   ```
   if (!validate()) {
                   cb.openComplete(BKException.Code.NoSuchLedgerExistsException, null, null);
                   return;
               }
   ```
   
   `validate` should probably just return a proper rc code.
   
   ```
   int rc = validate();
   if (Code.OK != rc) {
       cd.openComplete(rc);
      return;
   }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services