[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14028886#comment-14028886
 ] 

Rakesh R commented on ZOOKEEPER-1939:
-------------------------------------

When analysing the issue, its due to  insufficient time out value in tests.
{code}
2014-06-11 23:53:24,431 [myid:0] - WARN  
[QuorumPeer[myid=0]/127.0.0.1:11251:Follower@92] - Exception when following the 
leader
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at java.io.DataInputStream.readInt(DataInputStream.java:387)
        at 
org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63)
        at 
org.apache.zookeeper.server.quorum.QuorumPacket.deserialize(QuorumPacket.java:83)
        at 
org.apache.jute.BinaryInputArchive.readRecord(BinaryInputArchive.java:103)
        at 
org.apache.zookeeper.server.quorum.Learner.readPacket(Learner.java:160)
        at 
org.apache.zookeeper.server.quorum.Learner.syncWithLeader(Learner.java:376)
        at 
org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:85)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:974)
2014-06-11 23:53:24,432 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:MBeanRegistry@119] - Unregister MBean 
[org.apache.ZooKeeperService:name0=ReplicatedServer_id0,name1=replica.0,name2=Follower]
2014-06-11 23:53:24,432 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:Follower@194] - shutdown called
java.lang.Exception: shutdown Follower
        at 
org.apache.zookeeper.server.quorum.Follower.shutdown(Follower.java:194)
        at 
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:978)
2014-06-11 23:53:24,432 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:LearnerZooKeeperServer@161] - Shutting down
2014-06-11 23:53:24,432 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:ZooKeeperServer@428] - shutting down
2014-06-11 23:53:24,432 [myid:0] - WARN  
[QuorumPeer[myid=0]/127.0.0.1:11251:QuorumPeer@1021] - PeerState set to LOOKING
2014-06-11 23:53:24,432 [myid:0] - WARN  
[QuorumPeer[myid=0]/127.0.0.1:11251:QuorumPeer@1003] - QuorumPeer main thread 
exited
2014-06-11 23:53:24,432 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:MBeanRegistry@119] - Unregister MBean 
[org.apache.ZooKeeperService:name0=ReplicatedServer_id0]
2014-06-11 23:53:24,433 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:MBeanRegistry@119] - Unregister MBean 
[org.apache.ZooKeeperService:name0=ReplicatedServer_id0,name1=replica.0]
2014-06-11 23:53:24,433 [myid:0] - INFO  
[QuorumPeer[myid=0]/127.0.0.1:11251:MBeanRegistry@119] - Unregister MBean 
[org.apache.ZooKeeperService:name0=ReplicatedServer_id0,name1=replica.1]
{code}

*More Details:*
After shutdown the server test is waiting for 30sec. But the server is created 
with the following configuration
{code}
QuorumPeerTestBase.java
lineno#100
            fwriter.write("tickTime=4000\n");
            fwriter.write("initLimit=10\n");
            fwriter.write("syncLimit=5\n");
{code}

Using the above configuration, Learner#connectToLeader() will open the socket 
to the Leader with a timeout of sock.setSoTimeout(self.tickTime * 
self.initLimit); It will be 40000(millis) = 4000 * 10. But the test case is 
waiting only 30 secs and is the reason for the failure.

I've attached a patch which uses time out value relative to these 
configurations.

> ReconfigRecoveryTest.testNextConfigUnreachable is failing
> ---------------------------------------------------------
>
>                 Key: ZOOKEEPER-1939
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1939
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: tests
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1939.patch
>
>
> Following is the failure log message:
> 2014-06-11 23:53:22,538 [myid:] - INFO  
> [main:JUnit4ZKTestRunner$LoggedInvokeMethod@62] - TEST METHOD FAILED 
> testNextConfigUnreachable
> java.lang.AssertionError: QP failed to shutdown in 30 seconds: 
> QuorumPeer[myid=0]/127.0.0.1:11251
>       at org.junit.Assert.fail(Assert.java:93)
>       at org.apache.zookeeper.test.QuorumBase.shutdown(QuorumBase.java:393)
>       at 
> org.apache.zookeeper.server.quorum.QuorumPeerTestBase$TestQPMain.shutdown(QuorumPeerTestBase.java:52)
>       at 
> org.apache.zookeeper.server.quorum.QuorumPeerTestBase$MainThread.shutdown(QuorumPeerTestBase.java:161)
>       at 
> org.apache.zookeeper.server.quorum.ReconfigRecoveryTest.testNextConfigUnreachable(ReconfigRecoveryTest.java:268)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to