[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-28 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Attachment: zookeeper-776-fix.patch

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch, zookeeper-776-fix.patch, 
 zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-27 Thread Benjamin Reed (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Reed updated ZOOKEEPER-776:


Status: Open  (was: Patch Available)

there are two things we need to fix:

1) this just pushes the problems slightly. someone can still use a timeout of 1 
and run into the same problem. we should make the minimum timeout configurable 
using a system property. (i would suggest zookeeper.minTimeout) and set it to 
something reasonable like 100.
2) we should also put a similar check in the C client.

let me know if you are willing to make those changes. i'd be glad to pitch in 
if you cannot.


 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-27 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Attachment: zookeeper-776-fix.patch

This is an updated version that supports a default minTimeout of 100, and 
loading a new default from zookeeper.properties - zookeeper.minTimeout

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch, zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Patrick Hunt (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patrick Hunt updated ZOOKEEPER-776:
---

Fix Version/s: 3.4.0
  Component/s: c client

This would be a good hole to close. We should throw the exception/error  log 
when 0 is passed. We need to fix java and also verify/fix C client code. This 
would be an excellent first project for someone interested in becoming a 
contributor to zk. :-)

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Status: Patch Available  (was: Open)

commit 840f56d388582e1df39f7513aa7f4d4ce0610718
Author: Gregory Haskins ghask...@novell.com
Date:   Fri May 21 14:58:14 2010 -0400

javaclient: validate sessionTimeout field at ZooKeeper init

JIRA ZOOKEEPER-776 describes the following problem:

passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors
in subsequent operations. It would be ideal to capture this configuration
error at the source by throwing something like an IllegalArgument exception
when the bogus sessionTimeout is specified, instead of later when it is
utilized.

This patch is a proposal to fix the problem referenced above.

Signed-off-by: Gregory Haskins ghask...@novell.com

diff --git a/src/java/main/org/apache/zookeeper/ClientCnxn.java b/src/java/main/
index 8eb227d..682811b 100644
--- a/src/java/main/org/apache/zookeeper/ClientCnxn.java
+++ b/src/java/main/org/apache/zookeeper/ClientCnxn.java
@@ -353,6 +353,11 @@ public class ClientCnxn {
 this.sessionId = sessionId;
 this.sessionPasswd = sessionPasswd;
 
+   if (sessionTimeout = 0) {
+   throw new IOException(sessionTimeout  + sessionTimeout
+ +  is not valid);
+   }
+
 // parse out chroot, if any
 int off = hosts.indexOf('/');
 if (off = 0) {

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Status: Open  (was: Patch Available)

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Attachment: zookeeper-776-fix.patch

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

  Status: Patch Available  (was: Open)
Release Note: The attached patch is a proposed fix for the java client

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Status: Open  (was: Patch Available)

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Attachment: (was: zookeeper-776-fix.patch)

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Attachment: zookeeper-776-fix.patch

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.2.2, 3.3.0, 3.3.1
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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



[jira] Updated: (ZOOKEEPER-776) API should sanity check sessionTimeout argument

2010-05-21 Thread Gregory Haskins (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gregory Haskins updated ZOOKEEPER-776:
--

Status: Patch Available  (was: Open)

 API should sanity check sessionTimeout argument
 ---

 Key: ZOOKEEPER-776
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-776
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, java client
Affects Versions: 3.3.1, 3.3.0, 3.2.2
 Environment: OSX 10.6.3, JVM 1.6.0-20
Reporter: Gregory Haskins
Priority: Minor
 Fix For: 3.4.0

 Attachments: zookeeper-776-fix.patch


 passing in a 0 sessionTimeout to ZooKeeper() constructor leads to errors in 
 subsequent operations.  It would be ideal to capture this configuration error 
 at the source by throwing something like an IllegalArgument exception when 
 the bogus sessionTimeout is specified, instead of later when it is utilized.

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