[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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 0x1000169b7970000
2018-05-25 20:54:55,424 [myid:] - TRACE [SyncThread:0:ZooTrace@71] - 
SessionTrackerImpl --- Removing session 0x1000169b7970000
{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 
0x1000169b7970000 at /127.0.0.1:60428
2018-05-25 20:54:55,431 [myid:] - TRACE [NIOWorkerThread-6:ZooTrace@71] - 
Session 0x1000169b7970000 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 0x1000169b7970000 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 
0x1000169b7970000
{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)

Reply via email to