You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Vinay (JIRA)" <ji...@apache.org> on 2012/10/29 09:33:12 UTC

[jira] [Created] (BOOKKEEPER-446) BookKeeper.createLedger(..) should not mask the error with ZKException

Vinay created BOOKKEEPER-446:
--------------------------------

             Summary: BookKeeper.createLedger(..) should not mask the error with ZKException
                 Key: BOOKKEEPER-446
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-446
             Project: Bookkeeper
          Issue Type: Bug
          Components: bookkeeper-server
    Affects Versions: 4.2.0
            Reporter: Vinay


in {{BookKeeper.createLedger()}} following code is masking the error with ZKException. Should throw the original exception to client.

{code}        if (counter.getLh() == null) {
            LOG.error("ZooKeeper error: " + counter.getrc());
            throw BKException.create(Code.ZKException);
        }{code}



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-446) BookKeeper.createLedger(..) should not mask the error with ZKException

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485920#comment-13485920 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-446:
------------------------------------------------

Yep, we can see this.

{code}
 try {
            lh = new LedgerHandle(bk, ledgerId, metadata, digestType, passwd);
        } catch (GeneralSecurityException e) {
            LOG.error("Security exception while creating ledger: " + ledgerId, e);
            cb.createComplete(BKException.Code.DigestNotInitializedException, null, this.ctx);
            return;
        } catch (NumberFormatException e) {
            LOG.error("Incorrectly entered parameter throttle: " + bk.getConf().getThrottleValue(), e);
            cb.createComplete(BKException.Code.IncorrectParameterException, null, this.ctx);
            return;
        }

and 

} catch (BKNotEnoughBookiesException e) {
            LOG.error("Not enough bookies to create ledger");
            cb.createComplete(e.getCode(), null, this.ctx);
            return;
        }

{code}

Here the actual exception was masked due to the check above mentioned. 

How about using the original rc while creating BKException.
                
> BookKeeper.createLedger(..) should not mask the error with ZKException
> ----------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-446
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-446
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 4.2.0
>            Reporter: Vinay
>
> in {{BookKeeper.createLedger()}} following code is masking the error with ZKException. Should throw the original exception to client.
> {code}        if (counter.getLh() == null) {
>             LOG.error("ZooKeeper error: " + counter.getrc());
>             throw BKException.create(Code.ZKException);
>         }{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-446) BookKeeper.createLedger(..) should not mask the error with ZKException

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485934#comment-13485934 ] 

Sijie Guo commented on BOOKKEEPER-446:
--------------------------------------

yes, we need to use the original rc. 1) which is the right exception, 2) make sync interface and async interface consistent to use same exception.
                
> BookKeeper.createLedger(..) should not mask the error with ZKException
> ----------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-446
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-446
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 4.2.0
>            Reporter: Vinay
>
> in {{BookKeeper.createLedger()}} following code is masking the error with ZKException. Should throw the original exception to client.
> {code}        if (counter.getLh() == null) {
>             LOG.error("ZooKeeper error: " + counter.getrc());
>             throw BKException.create(Code.ZKException);
>         }{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (BOOKKEEPER-446) BookKeeper.createLedger(..) should not mask the error with ZKException

Posted by "Robin Dhamankar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Dhamankar updated BOOKKEEPER-446:
---------------------------------------

    Assignee: Robin Dhamankar
    
> BookKeeper.createLedger(..) should not mask the error with ZKException
> ----------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-446
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-446
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 4.2.0
>            Reporter: Vinay
>            Assignee: Robin Dhamankar
>
> in {{BookKeeper.createLedger()}} following code is masking the error with ZKException. Should throw the original exception to client.
> {code}        if (counter.getLh() == null) {
>             LOG.error("ZooKeeper error: " + counter.getrc());
>             throw BKException.create(Code.ZKException);
>         }{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (BOOKKEEPER-446) BookKeeper.createLedger(..) should not mask the error with ZKException

Posted by "Ivan Kelly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497246#comment-13497246 ] 

Ivan Kelly commented on BOOKKEEPER-446:
---------------------------------------

+1
                
> BookKeeper.createLedger(..) should not mask the error with ZKException
> ----------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-446
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-446
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 4.2.0
>            Reporter: Vinay
>            Assignee: Robin Dhamankar
>
> in {{BookKeeper.createLedger()}} following code is masking the error with ZKException. Should throw the original exception to client.
> {code}        if (counter.getLh() == null) {
>             LOG.error("ZooKeeper error: " + counter.getrc());
>             throw BKException.create(Code.ZKException);
>         }{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira