Flavio Paiva Junqueira commented on ZOOKEEPER-209:

Whether you guys like it or not, this is the way we currently deal with some 
configuration errors. Check this piece of code from QuorumPeerConfig.parse():


File myIdFile = new File(dataDir, "myid");
                if (!myIdFile.exists()) {
                    LOG.error(myIdFile.toString() + " file is missing");
                BufferedReader br = new BufferedReader(new 
                String myIdString;
                try {
                    myIdString = br.readLine();
                } finally {
                try {
                    conf.serverId = Long.parseLong(myIdString);
                } catch (NumberFormatException e) {
                    LOG.error(myIdString + " is not a number");
        } catch (Exception e) {


My patch complies with the way we handle critical configuration errors 
currently. Now we all agree that we should have a better way of dealing with 
config errors, and for that I have created jira 217. We hence have two options:

# We apply this patch and exit before getting an npe, which again complies with 
the way we handle config errors currently. Later we fix more generally the 
problem of handling configuration errors with a patch for 217;
# We make this jira dependent on 217 and work on 217 directly, and we get an 
npe until then, which is btw fine with me because we currently output an error 
message pointing out the configuration problem.  

> nullpointerexception if election port is not specified.
> -------------------------------------------------------
>                 Key: ZOOKEEPER-209
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-209
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Mahadev konar
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.0.1, 3.1.0
>         Attachments: ZOOKEEPER-209.patch
> The quoruom servers throw a nullpointer exception and still keep running. We 
> should atleast have a nice debug message and quit... 

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

Reply via email to