ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-612

Make Zookeeper C client can be compiled by gcc of early version

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Component/s: c client
    • Labels:
      None
    • Environment:

      Linux

    • Hadoop Flags:
      Reviewed
    • Release Note:
      to be able to compile c library with gcc 2.96 and greater.
    • Tags:
      gcc, c client

      Description

      The original C Client, Version 3.2.1, cannot be compiled successfully by the gcc of early version, due some declaration restriction. To compile the source code on the server with gcc of early version, I made some modification on the original source. What's more, some extra codes are added to make the client be compatible with the hosts list format: ip1:port1, ip2:port2... There is often a space after this kind of comma.

      1. patch
        12 kB
        Qian Ye
      2. patch
        12 kB
        Qian Ye
      3. ZOOKEEPER-612.patch
        13 kB
        Qian Ye
      4. ZOOKEEPER-612.patch
        13 kB
        Patrick Hunt
      5. ZOOKEEPER-612.patch
        12 kB
        Qian Ye
      6. ZOOKEEPER-612.patch
        13 kB
        Qian Ye

        Activity

        Hide
        Qian Ye added a comment -

        can be compiled by gcc 2.96

        Show
        Qian Ye added a comment - can be compiled by gcc 2.96
        Hide
        Qian Ye added a comment -

        fix a semicolon mistake

        Show
        Qian Ye added a comment - fix a semicolon mistake
        Hide
        Benjamin Reed added a comment -

        this looks good except for one piece of code:

        • hints.ai_flags = AI_ADDRCONFIG;
          + //hints.ai_flags = AI_ADDRCONFIG;
          + hints.ai_flags = 0;

        why do you remove AI_ADDRCONFIG?

        Show
        Benjamin Reed added a comment - this looks good except for one piece of code: hints.ai_flags = AI_ADDRCONFIG; + //hints.ai_flags = AI_ADDRCONFIG; + hints.ai_flags = 0; why do you remove AI_ADDRCONFIG?
        Hide
        Patrick Hunt added a comment -

        Qian thanks for the patch, in future please name the patch after the issue such as ZOOKEEPER-612.patch in this case. Thanks. FYI: http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute

        Show
        Patrick Hunt added a comment - Qian thanks for the patch, in future please name the patch after the issue such as ZOOKEEPER-612 .patch in this case. Thanks. FYI: http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute
        Hide
        Qian Ye added a comment -

        To Benjamin Reed:
        Because AI_ADDRCONFIG is available since glibc 2.3.3, and I had to compile this patch on a server with glibc 2.2.5, a very old version

        To Patrick Hunt:
        Thanks for your tips, really helpful

        Show
        Qian Ye added a comment - To Benjamin Reed: Because AI_ADDRCONFIG is available since glibc 2.3.3, and I had to compile this patch on a server with glibc 2.2.5, a very old version To Patrick Hunt: Thanks for your tips, really helpful
        Hide
        Patrick Hunt added a comment -

        @qian in that case I suggest you ifdef it, something like:

        ifdef ai_addrconfig
        foo = ai_addrconfig
        else
        foo = 0

        that sound reasonable?

        Show
        Patrick Hunt added a comment - @qian in that case I suggest you ifdef it, something like: ifdef ai_addrconfig foo = ai_addrconfig else foo = 0 that sound reasonable?
        Hide
        Qian Ye added a comment -

        yes Patrick, reasonable tips, a patch for this is attached, thx

        Show
        Qian Ye added a comment - yes Patrick, reasonable tips, a patch for this is attached, thx
        Hide
        Hadoop QA added a comment -

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

        +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 patch. The patch command could not apply the patch.

        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/37/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/12429617/ZOOKEEPER-612.patch against trunk revision 899383. +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 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/37/console This message is automatically generated.
        Hide
        Qian Ye added a comment -

        Is that because I didn't make the patch based on the latest svn chunk version? Should I make a new patch based on it?

        Show
        Qian Ye added a comment - Is that because I didn't make the patch based on the latest svn chunk version? Should I make a new patch based on it?
        Hide
        Mahadev konar added a comment -

        steven,
        yes you are right. you will have to create a patch against trunk.

        Show
        Mahadev konar added a comment - steven, yes you are right. you will have to create a patch against trunk.
        Hide
        Mahadev konar added a comment -

        sorry, I meant Qian....

        Show
        Mahadev konar added a comment - sorry, I meant Qian....
        Hide
        Qian Ye added a comment -

        New patch against trunk

        Show
        Qian Ye added a comment - New patch against trunk
        Hide
        Patrick Hunt added a comment -

        Qian, if you want a patch to be reviewed (ie you are done) the best thing is to click on "submit patch" link on the left hand side.
        this starts the CI patch review and lets us know that you're ready. If you submit an updated patch (such as this case)
        then just cancel the patch and re-submit. Regards. (I've done it this time for you)

        Show
        Patrick Hunt added a comment - Qian, if you want a patch to be reviewed (ie you are done) the best thing is to click on "submit patch" link on the left hand side. this starts the CI patch review and lets us know that you're ready. If you submit an updated patch (such as this case) then just cancel the patch and re-submit. Regards. (I've done it this time for you)
        Hide
        Hadoop QA added a comment -

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

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        -1 patch. The patch command could not apply the patch.

        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/39/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/12430694/ZOOKEEPER-612.patch against trunk revision 899383. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/39/console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        Qian, the patch is failing to apply to the trunk, can you take a look at the hadoopqabot output?

        Show
        Patrick Hunt added a comment - Qian, the patch is failing to apply to the trunk, can you take a look at the hadoopqabot output?
        Hide
        Patrick Hunt added a comment -

        I fixed the patch to be relative to trunk (was relative to trunk/src).

        Show
        Patrick Hunt added a comment - I fixed the patch to be relative to trunk (was relative to trunk/src).
        Hide
        Hadoop QA added a comment -

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

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        +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-h7.grid.sp2.yahoo.net/47/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/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/12431051/ZOOKEEPER-612.patch against trunk revision 901510. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +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-h7.grid.sp2.yahoo.net/47/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        this fails with the following:

        [exec] [exec] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/include -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/tests -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c -fPIC -DPIC -o .libs/zookeeper.o
        [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c: In function `zookeeper_process':
        [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c:1813: error: syntax error before "if"
        [exec] [exec] make: *** [zookeeper.lo] Error 1

        Show
        Patrick Hunt added a comment - this fails with the following: [exec] [exec] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/include -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/tests -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c -fPIC -DPIC -o .libs/zookeeper.o [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c: In function `zookeeper_process': [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c:1813: error: syntax error before "if" [exec] [exec] make: *** [zookeeper.lo] Error 1
        Hide
        Qian Ye added a comment -

        Thanks Patrick, I will take a look at it.

        Show
        Qian Ye added a comment - Thanks Patrick, I will take a look at it.
        Hide
        Qian Ye added a comment -

        update the patch

        Show
        Qian Ye added a comment - update the patch
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12431209/ZOOKEEPER-612.patch
        against trunk revision 902320.

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        +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-h7.grid.sp2.yahoo.net/52/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/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/12431209/ZOOKEEPER-612.patch against trunk revision 902320. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +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-h7.grid.sp2.yahoo.net/52/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/console This message is automatically generated.
        Hide
        Mahadev konar added a comment -

        +1 the patch looks good.

        Show
        Mahadev konar added a comment - +1 the patch looks good.
        Hide
        Mahadev konar added a comment -

        I just commited this. thanks qian.

        Show
        Mahadev konar added a comment - I just commited this. thanks qian.
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #680 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/680/)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #680 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/680/ )

          People

          • Assignee:
            Qian Ye
            Reporter:
            Qian Ye
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development