[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2018-06-11 Thread Michael Han (JIRA)


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

Michael Han commented on ZOOKEEPER-2421:


A side note is the test was commented out as part of ZOOKEEPER-111. In case 
someone is interested to dig the history from 10 years back :)

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>Assignee: Prasanth Mathialagan
>Priority: Major
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2018-06-11 Thread Michael Han (JIRA)


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

Michael Han commented on ZOOKEEPER-2421:


{quote}If we close a client, won't the session be expired by the server
{quote}
This is correct. 
{quote}If so, then the test must be doing wrong assertion, right?
{quote}
Yes, that test was not correct in today's ZooKeeper, because close() a zk 
handle will expire the session. My guess is when the test was written, the 
semantic of zk.close is a soft close where the client was only disconnected 
from server instead of doing a hard close where the session will be expired. My 
another guess is this testSessionReuse case was trying to cover the case where 
a client application crashes (soft close) and then restarts, and then it should 
try use the old session to reconnect to server. If that's the purpose, then as 
Brian pointed out, the testSession should cover this case. 

So it sounds good to me to just remove this test case.

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>Assignee: Prasanth Mathialagan
>Priority: Major
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2018-06-10 Thread Brian Nixon (JIRA)


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

Brian Nixon commented on ZOOKEEPER-2421:


[~prasanthm] This is an ancient test so someone who was involved in the project 
pre-2008 may have to provide some context around it and it's purpose. That's 
not me but I can say a bit after looking at the SessionTest file.

Session id reuse as such is not allowed in current ZooKeeper. There are two 
ways that this test could now go. One is to make sure that the second client 
can *not* use that session id, that there is no state retained server-side that 
allows a reuse after close. The second is to change it to a session moved style 
test but I think this scenario is already covered in testSession and 
testSessionMove.

If you don't see a useful way of reintroducing the test after a bit of poking, 
I'd say to put up a pull request removing it entirely and see if it gets 
accepted - it simply may no longer be meaningful.

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>Assignee: Prasanth Mathialagan
>Priority: Major
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2018-06-08 Thread Prasanth Mathialagan (JIRA)


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

Prasanth Mathialagan commented on ZOOKEEPER-2421:
-

Does anyone have any pointers to help me?

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>Assignee: Prasanth Mathialagan
>Priority: Major
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2018-05-25 Thread Prasanth Mathialagan (JIRA)

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

Prasanth Mathialagan commented on ZOOKEEPER-2421:
-

I just want to make sure I understood correctly what this test case is testing

Create a zk client and close it. Create second zk client using the same session 
id and password from the first client. Assert that the session id in the second 
client is same as the session id we used for creating the client.

I have some questions. If we close a client, won't the session be expired by 
the server? I see some logs indicating this,
{code:java}
2018-05-25 20:54:55,424 [myid:] - DEBUG [SyncThread:0:SessionTrackerImpl@218] - 
Removing session 0x1000169b797
2018-05-25 20:54:55,424 [myid:] - TRACE [SyncThread:0:ZooTrace@71] - 
SessionTrackerImpl --- Removing session 0x1000169b797
{code}
When the second client tries to connect using the same session id,
{code:java}
2018-05-25 20:54:55,431 [myid:] - INFO  
[NIOWorkerThread-6:ZooKeeperServer@1040] - Client attempting to renew session 
0x1000169b797 at /127.0.0.1:60428
2018-05-25 20:54:55,431 [myid:] - TRACE [NIOWorkerThread-6:ZooTrace@71] - 
Session 0x1000169b797 is valid: false
2018-05-25 20:54:55,431 [myid:] - TRACE [NIOWorkerThread-6:NIOServerCnxn@156] - 
Add a buffer to outgoingBuffers, sk sun.nio.ch.SelectionKeyImpl@5be8980 is 
valid: true
2018-05-25 20:54:55,431 [myid:] - INFO  [NIOWorkerThread-6:ZooKeeperServer@750] 
- Invalid session 0x1000169b797 for client /127.0.0.1:60428, probably 
expired
2018-05-25 20:54:55,431 [myid:] - TRACE [NIOWorkerThread-6:NIOServerCnxn@156] - 
Add a buffer to outgoingBuffers, sk sun.nio.ch.SelectionKeyImpl@5be8980 is 
valid: true
2018-05-25 20:54:55,432 [myid:] - INFO  [NIOWorkerThread-7:NIOServerCnxn@627] - 
Closed socket connection for client /127.0.0.1:60428 which had sessionid 
0x1000169b797
{code}
server finds the session as invalid and closes the connection to the new client 
abruptly.

Is this the expected behavior? If so, then the test must be doing wrong 
assertion, right?

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>Priority: Major
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ZOOKEEPER-2421) testSessionReuse is commented out

2017-08-25 Thread Nikhil Bhide (JIRA)

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

Nikhil Bhide commented on ZOOKEEPER-2421:
-

This test was commented in Aug'2008 when junit was upgraded to 4.4 from 4.1 as 
a part of Zookeeper-75. I have made few required changes and test case is 
working as per the expectation. 

Please assign this issue to me.

> testSessionReuse is commented out
> -
>
> Key: ZOOKEEPER-2421
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2421
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Flavio Junqueira
>
> This test case in SessionTest:
> {noformat}
>testSessionReuse
> {noformat}
> is commented out.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)