You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Mahadev konar (JIRA)" <ji...@apache.org> on 2008/10/28 00:23:44 UTC

[jira] Created: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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
             Fix For: 3.1.0


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.


[jira] Commented: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Patrick Hunt commented on ZOOKEEPER-209:
----------------------------------------

Good catch Mahadev. 

Flavio, how about a new "InvalidConfigException" with proper message about what caused the issue?


> 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.


[jira] Updated: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Benjamin Reed updated ZOOKEEPER-209:
------------------------------------

    Hadoop Flags: [Reviewed]

+1 Looks good Flavio

> 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.1
>            Reporter: Mahadev konar
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.0.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.


[jira] Updated: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Patrick Hunt updated ZOOKEEPER-209:
-----------------------------------

        Fix Version/s:     (was: 3.0.0)
                       3.1.0
                       3.0.1
    Affects Version/s:     (was: 3.0.1)
                       3.0.0

> 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.


[jira] Resolved: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Mahadev konar resolved ZOOKEEPER-209.
-------------------------------------

    Resolution: Fixed

fixed with ZOOKEEPER-217.

> 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.


[jira] Updated: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Mahadev konar updated ZOOKEEPER-209:
------------------------------------

    Status: Open  (was: Patch Available)

cancelling this patch.. since its fixed in ZOOKEEPER-217.

> 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.


[jira] Commented: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Mahadev konar commented on ZOOKEEPER-209:
-----------------------------------------

-1 ... please do not add system.exit in any place except main() methods. All the other places should throw an exception and those exceptions should be caught at main() method and then exit... 



> 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.


[jira] Commented: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Mahadev konar commented on ZOOKEEPER-209:
-----------------------------------------

option 2 is fine with me... there is not point chekc ing in this patch since we will be changing that neway... thanks for creating ZOOKEEPER-217 flavio ... hope you can work on it ... :)

> 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.


[jira] Updated: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Flavio Paiva Junqueira updated ZOOKEEPER-209:
---------------------------------------------

        Fix Version/s:     (was: 3.1.0)
                       3.0.0
    Affects Version/s:     (was: 3.0.0)
                       3.0.1
               Status: Patch Available  (was: Open)

> 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.1
>            Reporter: Mahadev konar
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.0.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.


[jira] Assigned: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Flavio Paiva Junqueira reassigned ZOOKEEPER-209:
------------------------------------------------

    Assignee: Flavio Paiva Junqueira

> 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.1.0
>
>
> 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.


[jira] Commented: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

Posted by "Flavio Paiva Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645425#action_12645425 ] 

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():

{code:java}

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

{code}


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.


[jira] Updated: (ZOOKEEPER-209) nullpointerexception if election port is not specified.

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

Flavio Paiva Junqueira updated ZOOKEEPER-209:
---------------------------------------------

    Attachment: ZOOKEEPER-209.patch

I thought that during our discussions over 127 we had agreed that outputting an error message would be sufficient given the way we are parsing the configuration file and checking for errors. Without an election port, the default leader election cannot work, and consequently ZooKeeper won't work either. 

I am submitting a patch that makes a server output an error message and exit in the case that election ports are not provided.

> 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.1
>            Reporter: Mahadev konar
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.0.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.