ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1493

C Client: zookeeper_process doesn't invoke completion callback if zookeeper_close has been called

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.3, 3.3.5
    • Fix Version/s: 3.3.6, 3.4.4, 3.5.0
    • Component/s: c client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In ZOOKEEPER-804, we added a check in zookeeper_process() to see if zookeeper_close() has been called. This was to avoid calling assert(cptr) on a NULL pointer, as dequeue_completion() returns NULL if the sent_requests queue has been cleared by free_completion() from zookeeper_close(). However, we should still call the completion if it is not NULL.

      1. ZOOKEEPER-1493.patch
        0.8 kB
        Michi Mutsuzaki
      2. ZOOKEEPER-1493_3_3.patch
        0.8 kB
        Michi Mutsuzaki
      3. ZOOKEEPER-1493_3_4.patch
        0.8 kB
        Michi Mutsuzaki

        Activity

        Hide
        Jacky007 added a comment -

        a memory leak for missing free_buffer(bptr)

        Show
        Jacky007 added a comment - a memory leak for missing free_buffer(bptr)
        Hide
        Jacky007 added a comment -

        this patch also solve a potential hang int zookeeper_close()

        Show
        Jacky007 added a comment - this patch also solve a potential hang int zookeeper_close()
        Hide
        Jacky007 added a comment -

        this patch also solve a potential hang int zookeeper_close()

        Show
        Jacky007 added a comment - this patch also solve a potential hang int zookeeper_close()
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1628 (See https://builds.apache.org/job/ZooKeeper-trunk/1628/)
        ZOOKEEPER-1493. C Client: zookeeper_process doesn't invoke completion callback if zookeeper_close has been called (Michi Mutsuzaki via phunt and mahadev) (Revision 1366784)

        Result = SUCCESS
        phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1366784
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/c/src/zookeeper.c
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1628 (See https://builds.apache.org/job/ZooKeeper-trunk/1628/ ) ZOOKEEPER-1493 . C Client: zookeeper_process doesn't invoke completion callback if zookeeper_close has been called (Michi Mutsuzaki via phunt and mahadev) (Revision 1366784) Result = SUCCESS phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1366784 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/c/src/zookeeper.c
        Hide
        Patrick Hunt added a comment -

        Committed, thanks Michi!

        Show
        Patrick Hunt added a comment - Committed, thanks Michi!
        Hide
        Mahadev konar added a comment -

        Sure. I looked at the patch it looks fine to me. +1 for committing.

        Show
        Mahadev konar added a comment - Sure. I looked at the patch it looks fine to me. +1 for committing.
        Hide
        Michi Mutsuzaki added a comment -

        It would be difficult to unit test this without refactoring the code. I did run manual tests to verify the patch fixed the issue, though.

        --Michi

        Show
        Michi Mutsuzaki added a comment - It would be difficult to unit test this without refactoring the code. I did run manual tests to verify the patch fixed the issue, though. --Michi
        Hide
        Patrick Hunt added a comment -

        Michi would it be possible to test this change?

        Show
        Patrick Hunt added a comment - Michi would it be possible to test this change?
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12534135/ZOOKEEPER-1493_3_4.patch
        against trunk revision 1355657.

        +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 new tests are needed for this patch.
        Also please list what manual steps were performed to verify 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 (version 1.3.9) 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: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//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/12534135/ZOOKEEPER-1493_3_4.patch against trunk revision 1355657. +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 new tests are needed for this patch. Also please list what manual steps were performed to verify 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 (version 1.3.9) 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: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1118//console This message is automatically generated.
        Hide
        Michi Mutsuzaki added a comment -
        Show
        Michi Mutsuzaki added a comment - Hi Mahadev, Here are the patches for 3.3, 3.4, and trunk: branch-3.3: https://issues.apache.org/jira/secure/attachment/12534134/ZOOKEEPER-1493_3_3.patch branch-3.4: https://issues.apache.org/jira/secure/attachment/12534135/ZOOKEEPER-1493_3_4.patch trunk: https://issues.apache.org/jira/secure/attachment/12532779/ZOOKEEPER-1493.patch I'll update patches for ZOOKEEPER-1494 once these patches are checked in. Thanks! --Michi
        Hide
        Mahadev konar added a comment -

        Again the patch looks good but we'll need a patch for branch 3.3 and 3.4.

        Show
        Mahadev konar added a comment - Again the patch looks good but we'll need a patch for branch 3.3 and 3.4.

          People

          • Assignee:
            Michi Mutsuzaki
            Reporter:
            Michi Mutsuzaki
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development