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

Rakesh R commented on ZOOKEEPER-1904:
-------------------------------------

Thanks [~rgs], [~michim] for the quick reviews.

bq.? Did you actually see an NPE error?  Couldn't see that from the stack 
traces you pasted. 
please see 
https://builds.apache.org/job/ZooKeeper-3.4-WinVS2008_java/465/consoleFull

bq. If so, perhaps we should synchronize setting sockKey to null and this 
method as mentioned in the TODO comment?
I feel adding only synchronization won't help us. Please see what actually 
happens in the tests.

step-1) zk.pauseCnxn(3000); has scheduled the Thread to perform 
cnxn.sendThread.testableCloseSocket();. Assume its not actually starts the 
thread execution.
step-2) On the other side "Main thread" proceeds with zk2.close(); and now the 
NodeDeleted event reaches to the MyWatcher(0) and sets the flag to 
connected=true. 
step-3) watches#waitForDisconnected(60000); This will see connected=true and is 
failing.

If you see the testcase, line no#199 it is sleeping for just 50ms, but it may 
not be sufficient to guarantee the cnxn.sendThread.testableCloseSocket() 
execution. To pass the test, watcher(0) shouldn't get the NodeDeleted event. In 
my proposed patch, tests will first pause the client 
connection(state:Disconnected), then moves ahead with zk2.close() and so on.

Does this sound good to you guys ?

> WatcherTest#testWatchAutoResetWithPending is failing
> ----------------------------------------------------
>
>                 Key: ZOOKEEPER-1904
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1904
>             Project: ZooKeeper
>          Issue Type: Sub-task
>          Components: tests
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 3.4.7
>
>         Attachments: ZOOKEEPER-1904.patch, ZOOKEEPER-1904.patch
>
>
> Following is the stacktrace taken from [Build : 
> ZooKeeper-3.4-WinVS2008_java/465|https://builds.apache.org/job/ZooKeeper-3.4-WinVS2008_java/465/]
> {code}
>     [junit] 2014-03-19 09:28:50,020 [myid:] - INFO  
> [main-SendThread(127.0.0.1:11278):ClientCnxn$SendThread@975] - Opening socket 
> connection to server 127.0.0.1/127.0.0.1:11278. Will not attempt to 
> authenticate using SASL (unknown error)
>     [junit] 2014-03-19 09:28:51,025 [myid:] - WARN  
> [main-SendThread(127.0.0.1:11278):ClientCnxn$SendThread@1102] - Session 
> 0x144d9ab1f9e0000 for server null, unexpected error, closing socket 
> connection and attempting reconnect
>     [junit] java.net.ConnectException: Connection refused: no further 
> information
>     [junit]   at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>     [junit]   at 
> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
>     [junit]   at 
> org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
>     [junit]   at 
> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
>     [junit] 2014-03-19 09:28:52,661 [myid:] - INFO  
> [main-SendThread(127.0.0.1:11278):ClientCnxn$SendThread@975] - Opening socket 
> connection to server 127.0.0.1/127.0.0.1:11278. Will not attempt to 
> authenticate using SASL (unknown error)
>     [junit] 2014-03-19 09:28:53,640 [myid:] - WARN  
> [main-SendThread(127.0.0.1:11278):ClientCnxn$SendThread@1102] - Session 
> 0x144d9ab1f9e0000 for server null, unexpected error, closing socket 
> connection and attempting reconnect
>     [junit] java.net.ConnectException: Connection refused: no further 
> information
>     [junit]   at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
>     [junit]   at 
> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
>     [junit]   at 
> org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
>     [junit]   at 
> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
>     [junit] 2014-03-19 09:28:55,435 [myid:] - INFO  
> [main-SendThread(127.0.0.1:11278):ClientCnxn$SendThread@975] - Opening socket 
> connection to server 127.0.0.1/127.0.0.1:11278. Will not attempt to 
> authenticate using SASL (unknown error)
>     [junit] 2014-03-19 09:28:56,111 [myid:] - INFO  
> [main:JUnit4ZKTestRunner$LoggedInvokeMethod@62] - TEST METHOD FAILED 
> testWatchAutoResetWithPending
>     [junit] java.util.concurrent.TimeoutException: Did not disconnect
>     [junit]   at 
> org.apache.zookeeper.test.ClientBase$CountdownWatcher.waitForDisconnected(ClientBase.java:145)
>     [junit]   at 
> org.apache.zookeeper.test.WatcherTest.testWatchAutoResetWithPending(WatcherTest.java:202)
>     [junit]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> {code}



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

Reply via email to