Return-Path: X-Original-To: apmail-zookeeper-dev-archive@www.apache.org Delivered-To: apmail-zookeeper-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8161D716C for ; Thu, 11 Aug 2011 03:46:13 +0000 (UTC) Received: (qmail 67935 invoked by uid 500); 11 Aug 2011 03:46:12 -0000 Delivered-To: apmail-zookeeper-dev-archive@zookeeper.apache.org Received: (qmail 67445 invoked by uid 500); 11 Aug 2011 03:45:59 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 67392 invoked by uid 99); 11 Aug 2011 03:45:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 03:45:53 +0000 X-ASF-Spam-Status: No, hits=-2000.8 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 03:45:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4D883B611C for ; Thu, 11 Aug 2011 03:45:28 +0000 (UTC) Date: Thu, 11 Aug 2011 03:45:28 +0000 (UTC) From: "Hadoop QA (JIRA)" To: dev@zookeeper.apache.org Message-ID: <1917657205.26602.1313034328314.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <385368725.34534.1308862967634.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (ZOOKEEPER-1108) Various bugs in zoo_add_auth in C MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ZOOKEEPER-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082886#comment-13082886 ] Hadoop QA commented on ZOOKEEPER-1108: -------------------------------------- -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12489102/ZOOKEEPER-1108.patch against trunk revision 1152141. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 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 (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 failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/438//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/438//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/438//console This message is automatically generated. > Various bugs in zoo_add_auth in C > --------------------------------- > > Key: ZOOKEEPER-1108 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1108 > Project: ZooKeeper > Issue Type: Bug > Components: c client > Affects Versions: 3.3.3 > Reporter: Dheeraj Agrawal > Assignee: Dheeraj Agrawal > Priority: Blocker > Fix For: 3.4.0 > > Attachments: ZOOKEEPER-1108.patch, ZOOKEEPER-1108.patch, ZOOKEEPER-1108.patch > > > 3 issues: > In zoo_add_auth: there is a race condition: > 2940 // [ZOOKEEPER-800] zoo_add_auth should return ZINVALIDSTATE if > 2941 // the connection is closed. > 2942 if (zoo_state(zh) == 0) { > 2943 return ZINVALIDSTATE; > 2944 } > when we do zookeeper_init, the state is initialized to 0 and above we check if state = 0 then throw exception. > There is a race condition where the doIo thread is slow and has not changed the state to CONNECTING, then you end up returning back ZKINVALIDSTATE. > The problem is we use 0 for CLOSED state and UNINITIALIZED state. in case of uninitialized case it should let it go through. > 2nd issue: > Another Bug: in send_auth_info, the check is not correct > while (auth->next != NULL) { //--BUG: in cases where there is only one auth in the list, this will never send that auth, as its next will be NULL > rc = send_info_packet(zh, auth); > auth = auth->next; > } > FIX IS: > do { > rc = send_info_packet(zh, auth); > auth = auth->next; > } while (auth != NULL); //this will make sure that even if there is one auth ,that will get sent. > 3rd issue: > 2965 add_last_auth(&zh->auth_h, authinfo); > 2966 zoo_unlock_auth(zh); > 2967 > 2968 if(zh->state == ZOO_CONNECTED_STATE || zh->state == ZOO_ASSOCIATING_STATE) > 2969 return send_last_auth_info(zh); > if it is connected, we only send the last_auth_info, which may be different than the one we added, as we unlocked it before sending it. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira