You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Patrick Hunt (JIRA)" <ji...@apache.org> on 2009/10/08 18:30:31 UTC

[jira] Created: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

improve client testability - allow test client to access connected server location
----------------------------------------------------------------------------------

                 Key: ZOOKEEPER-544
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
             Project: Zookeeper
          Issue Type: Improvement
          Components: c client, java client, tests
            Reporter: Patrick Hunt
             Fix For: 3.3.0


This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
verify you are handling failover correctly. Similar for session expiration testing.

however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
want to hide. 

also we should provide this in both the c and java clients

I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
have less options, we can just rely on docs for now. 

In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.

We should add the following at the same time:

toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)

the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
clear docs that this is for testing purposes only!


Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Open  (was: Patch Available)

trying hudson out agian, after all the changes went in.... 

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Open  (was: Patch Available)

updating the patch to trunk.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Patch Available  (was: Open)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Attachment: ZOOKEEPER-544.patch

screwed up the last patch. upload a new one and trying hudson again!

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-544:
-----------------------------------

    Assignee: Patrick Hunt
      Status: Patch Available  (was: Open)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774875#action_12774875 ] 

Hadoop QA commented on ZOOKEEPER-544:
-------------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12424336/ZOOKEEPER-544.patch
  against trunk revision 833938.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 6 new or modified tests.

    +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 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: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/57/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/57/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/57/console

This message is automatically generated.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Reed updated ZOOKEEPER-544:
------------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

Committed revision 896143.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792342#action_12792342 ] 

Hadoop QA commented on ZOOKEEPER-544:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12424336/ZOOKEEPER-544.patch
  against trunk revision 892111.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 6 new or modified tests.

    -1 patch.  The patch command could not apply the patch.

Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/94/console

This message is automatically generated.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797219#action_12797219 ] 

Hudson commented on ZOOKEEPER-544:
----------------------------------

Integrated in ZooKeeper-trunk #655 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/655/])
    

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792642#action_12792642 ] 

Hadoop QA commented on ZOOKEEPER-544:
-------------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12428459/ZOOKEEPER-544.patch
  against trunk revision 892111.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 6 new or modified tests.

    +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 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: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/96/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/96/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/96/console

This message is automatically generated.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Patch Available  (was: Open)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778993#action_12778993 ] 

Patrick Hunt commented on ZOOKEEPER-544:
----------------------------------------

discoverability. I put testable* to make it easier for clients to do test (rather than figure out how to get this).

Also, exposing cnxn means it's harder to make changes to the implementation as the user code
will be closely coupled to the guts of cnxn. this allows for changes under the covers (for common
use cases at least)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778980#action_12778980 ] 

Benjamin Reed commented on ZOOKEEPER-544:
-----------------------------------------

why do you have testableLocalSocketAddress in ZooKeeper? The cnxn object is protected. You don't need that method is ZooKeeper do you?

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792400#action_12792400 ] 

Hadoop QA commented on ZOOKEEPER-544:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12428405/ZOOKEEPER-544.patch
  against trunk revision 892111.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 6 new or modified tests.

    +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 appears to cause Findbugs to fail.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    -1 core tests.  The patch failed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/95/testReport/
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/95/console

This message is automatically generated.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Patch Available  (was: Open)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Attachment: ZOOKEEPER-544.patch

updating the patch to trunk. Resolved the conflict. 

Pat, can you check if the patch is all fine and I didnt miss anything.

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-544:
-----------------------------------

    Attachment: ZOOKEEPER-544.patch

Added some methods to the java to improve testability - in particular to
get the tostring of zk object and allow access to local/report ip/port. Also
added some stats for tracking sent/recv information - included in  tostring.
Added tests of these features - see the log output for examples.

Note to reviewer - be sure to check some cleanups I did in the code surrounding
the send/recv counts. Note my attempt to inform potential users that these
methods are meant for testing by 1) making them protected, 2) naming, 3)
javadoc comments.

Also, it would be great to get c versions of these 3 new methods. Ben?

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-544) improve client testability - allow test client to access connected server location

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-544:
------------------------------------

    Status: Open  (was: Patch Available)

> improve client testability - allow test client to access connected server location
> ----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-544
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-544
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: c client, java client, tests
>            Reporter: Patrick Hunt
>            Assignee: Patrick Hunt
>             Fix For: 3.3.0
>
>         Attachments: ZOOKEEPER-544.patch, ZOOKEEPER-544.patch, ZOOKEEPER-544.patch
>
>
> This came up recently on the user list. If you are developing tests for your zk client you need to be able to access the server that your
> session is currently connected to. The reason is that your test needs to know which server in the quorum to shutdown in order to
> verify you are handling failover correctly. Similar for session expiration testing.
> however we should be careful, we prefer not to expose this to all clients, this is an implementation detail that we typically
> want to hide. 
> also we should provide this in both the c and java clients
> I suspect we should add a protected method on ZooKeeper. This will make a higher bar (user will have to subclass) for 
> the user to access this method. In tests it's fine, typically you want a "TestableZooKeeper" class anyway. In c we unfortunately
> have less options, we can just rely on docs for now. 
> In both cases (c/java) we need to be very very clear in the docs that this is for testing only and to clearly define semantics.
> We should add the following at the same time:
> toString() method to ZooKeeper which includes server ip/port, client port, any other information deemed useful (connection stats like send/recv?)
> the java ZooKeeper is missing "deterministic connection order" that the c client has. this is also useful for testing. again, protected and 
> clear docs that this is for testing purposes only!
> Any other things we should expose?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.