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 2008/12/10 00:42:44 UTC

[jira] Updated: (ZOOKEEPER-16) Need to do path validation

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

Patrick Hunt updated ZOOKEEPER-16:
----------------------------------

    Attachment: ZOOKEEPER-16.patch

this patch starts to validate the path, but quickly runs into an issue.

create(//sync) handles validation fine, we throw KeeperException.BadArgumentException

however create(//async) is not declared to throw KeeperException

we can call the async callback handler with rc code of BadArgument, however this is suboptimal, it would be much better to throw an exception right away. We lose the error message as well (contained by the exception)

our best option afiak is to deprecate the current async methods and create new async methods which throw KE and have "Path path" arguments instead of "String path" arguments. We could validate the path when Path is created (a new zk type), also passing around Path objects might allow us to optimize serialization/deser during the marshalling stages.

It really is unfortunate that the async methods aren't declared to throw KeeperException, adding this would allow error handling flexibility in future (perhaps some other error type we haven't throught of, separate from path validation).

Thoughts?


> Need to do path validation
> --------------------------
>
>                 Key: ZOOKEEPER-16
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-16
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: c client, java client, server
>            Reporter: Patrick Hunt
>             Fix For: 3.1.0
>
>         Attachments: ZOOKEEPER-16.patch
>
>
> Moved from SourceForge to Apache.
> http://sourceforge.net/tracker/index.php?func=detail&aid=1963141&group_id=209147&atid=1008544

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