ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-504

ClassCastException in LedgerManagementProcessor

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: contrib-bookkeeper
    • Labels:
      None

      Description

      java.lang.ClassCastException: org.apache.bookkeeper.client.LedgerManagementProcessor$OpenLedgerOp cannot be cast to org.apache.bookkeeper.client.LedgerManagementProcessor$CloseLedgerOp
      at org.apache.bookkeeper.client.LedgerManagementProcessor.processResult(LedgerManagementProcessor.java:1083)

      This seems to be happening because its a nested switch case statement. And the OPEN: case, doesn't ever call a break. It only calls a break from the inner switch-case and hence falls through into the CLOSE: case.

      1. ZOOKEEPER-504.1.patch
        2 kB
        Utkarsh Srivastava
      2. ZOOKEEPER-504.patch
        1 kB
        Utkarsh Srivastava
      3. ZOOKEEPER-504.patch
        1 kB
        Utkarsh Srivastava

        Issue Links

          Activity

          Hide
          Utkarsh Srivastava added a comment -

          The case that reproduces all these problem is when a client tries to open a ledger that has not been properly closed.

          After fixing the original classcast problem and chasing further, ran into couple more issues. Attaching the patch for 3 problems that we found. Still cant get the case to work as we get a ZK error in the asyncOpen callback,

          Show
          Utkarsh Srivastava added a comment - The case that reproduces all these problem is when a client tries to open a ledger that has not been properly closed. After fixing the original classcast problem and chasing further, ran into couple more issues. Attaching the patch for 3 problems that we found. Still cant get the case to work as we get a ZK error in the asyncOpen callback,
          Hide
          Utkarsh Srivastava added a comment -

          There seem to be plenty of other problems with LedgerManagementProcessor. In this patch, I fix some of them just by visual inspection, and not by writing comprehensive test case. One pattern I saw was that after calling the callback for ops, there was no return statement, and the code would go on to do other things. I fixed all occurrences of those bugs.

          But my create callback is still called multiple time (ZOOKEEPER-502), and I still cant open a ledger that was not properly closed.

          Show
          Utkarsh Srivastava added a comment - There seem to be plenty of other problems with LedgerManagementProcessor. In this patch, I fix some of them just by visual inspection, and not by writing comprehensive test case. One pattern I saw was that after calling the callback for ops, there was no return statement, and the code would go on to do other things. I fixed all occurrences of those bugs. But my create callback is still called multiple time ( ZOOKEEPER-502 ), and I still cant open a ledger that was not properly closed.
          Hide
          Utkarsh Srivastava added a comment -

          Oops attached wrong file.

          Show
          Utkarsh Srivastava added a comment - Oops attached wrong file.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12415907/ZOOKEEPER-504.1.patch
          against trunk revision 802188.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no tests are needed for this patch.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12415907/ZOOKEEPER-504.1.patch against trunk revision 802188. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/179/console This message is automatically generated.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12415907/ZOOKEEPER-504.1.patch
          against trunk revision 808557.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no tests are needed for this patch.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12415907/ZOOKEEPER-504.1.patch against trunk revision 808557. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/3/console This message is automatically generated.
          Hide
          Mahadev konar added a comment -

          cancelling the patch for now .... utkarsh mentioned that he had made more changes and will be uploading the changes soon...

          Show
          Mahadev konar added a comment - cancelling the patch for now .... utkarsh mentioned that he had made more changes and will be uploading the changes soon...
          Hide
          Mahadev konar added a comment -

          Committed in ZOOKEEPER-507.

          Show
          Mahadev konar added a comment - Committed in ZOOKEEPER-507 .

            People

            • Assignee:
              Utkarsh Srivastava
              Reporter:
              Utkarsh Srivastava
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development