I believe this is different from ZOOKEEPER-1270 because in the 1270 case it seems like the clients are attempting to connect but the servers are not accepting (notice the stat commands are being dropped due to no server running)

Patrick Hunt
added a comment - 05/Nov/11 04:34 Matthias - that's great. ps. Are you seeing the same failures as we have on Apache Jenkins?
https://builds.apache.org/view/S-Z/view/ZooKeeper/job/ZooKeeper-trunk-WinVS2008_java/10/#showFailuresLink
(granted this is trunk not 3.3)

Patrick Hunt
added a comment - 02/Nov/11 21:59 I reviewed and tested this patch on 33/34/trunk, green in all three cases. I also ran this on my CI hardware and I no longer see the issue there either.
The proof will be on solaris though - this is reproduceable on solaris with the original test set.
Thanks Mahadev!

Patrick Hunt
added a comment - 02/Nov/11 21:37 I don't see any way to add a test in 3.3 either w/o significant structural changes (such as the refactorings that went into 3.4, allowing the mock testing used there).
Given we can reproduce this on apache jenkins solaris systems, it seems that we already have test coverage for this. no?

-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.

Hadoop QA
added a comment - 02/Nov/11 21:03 -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12502033/ZOOKEEPER-1271-3.3.patch
against trunk revision 1196025.
+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 patch. The patch command could not apply the patch.
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/769//console
This message is automatically generated.

Patch for 3.3 branch. The code base in 3.3 makes it almost impossible to write a unit test for this. We can just commit the patch for 3.3 branch? Lesser chances of fix getting removed in 3.3. We can just run the patch on solaris machine and see if it works. Sounds good?

Mahadev konar
added a comment - 02/Nov/11 20:46 Patch for 3.3 branch. The code base in 3.3 makes it almost impossible to write a unit test for this. We can just commit the patch for 3.3 branch? Lesser chances of fix getting removed in 3.3. We can just run the patch on solaris machine and see if it works. Sounds good?

Hadoop QA
added a comment - 02/Nov/11 03:52 -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12501905/ZOOKEEPER-1271.patch
against trunk revision 1196025.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 2 new or modified tests.
-1 patch. The patch command could not apply the patch.
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/758//console
This message is automatically generated.

-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.

Hadoop QA
added a comment - 01/Nov/11 21:04 -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12501827/ZOOKEEPER-1271.patch
against trunk revision 1196025.
+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/756//testReport/
Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/756//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/756//console
This message is automatically generated.

Ted Dunning
added a comment - 31/Oct/11 21:23 I traced through this code and it looks like re-throwing the exception is a good idea. I certainly don't see any problems.
On the other side, this is definitely not an area of code that I know well.

if an exception is thrown inside the try the socket is closed, however sockKey is left set. As a result he client will not attempt to reconnect to the server (typically it will continue to retry every second or so). I think the bug here is that the exception should be rethrown, otw the 'cleanup' routine in SendThread.run will not be executed.

Patrick Hunt
added a comment - 29/Oct/11 17:46 - edited The error handling added to ZOOKEEPER-1174 is causing this bug.
try {
sockKey = sock.register(selector, SelectionKey.OP_CONNECT);
boolean immediateConnect = sock.connect(addr);
if (immediateConnect) {
sendThread.primeConnection();
}
} catch (IOException e) {
LOG.error("Unable to open socket to " + addr);
sock.close();
}
if an exception is thrown inside the try the socket is closed, however sockKey is left set. As a result he client will not attempt to reconnect to the server (typically it will continue to retry every second or so). I think the bug here is that the exception should be rethrown, otw the 'cleanup' routine in SendThread.run will not be executed.