You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Flavio Paiva Junqueira (JIRA)" <ji...@apache.org> on 2009/04/02 18:32:13 UTC

[jira] Created: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

WeakHashMap in Bookie.java causes NPE
-------------------------------------

                 Key: ZOOKEEPER-360
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
             Project: Zookeeper
          Issue Type: Bug
          Components: contrib-bookkeeper
    Affects Versions: 3.1.1
            Reporter: Flavio Paiva Junqueira
            Assignee: Flavio Paiva Junqueira
             Fix For: 3.2.0


We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Updated: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira updated ZOOKEEPER-360:
---------------------------------------------

    Status: Open  (was: Patch Available)

Tryning to please hudson.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira commented on ZOOKEEPER-360:
--------------------------------------------------

The part of the bookie code changed with this patch was already exercised before on tests, and the reason why they didn't catch the bug is because the error is caused by garbage collected entries in masterKeys (WeakHashMap). I have removed this data structure in this patch, so that there is no more such garbarge collected entries. The code path is still exercised by unit tests, though. 

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Hudson commented on ZOOKEEPER-360:
----------------------------------

Integrated in ZooKeeper-trunk #271 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/271/])
    . WeakHashMap in Bookie.java causes NPE (flavio via mahadev)


> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Updated: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira updated ZOOKEEPER-360:
---------------------------------------------

    Status: Patch Available  (was: Open)

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Updated: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Mahadev konar updated ZOOKEEPER-360:
------------------------------------

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

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Hadoop QA commented on ZOOKEEPER-360:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12404469/ZOOKEEPER-BOOKKEEPER-360.patch
  against trunk revision 761126.

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

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no tests are needed for this patch.

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

This message is automatically generated.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Hadoop QA commented on ZOOKEEPER-360:
-------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12404469/ZOOKEEPER-BOOKKEEPER-360.patch
  against trunk revision 761126.

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

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no tests are needed for this patch.

    +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 failed core unit tests.

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

Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/10/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/10/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-vesta.apache.org/10/console

This message is automatically generated.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Mahadev konar commented on ZOOKEEPER-360:
-----------------------------------------

I just committed this. thanks flavio.. 

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Patrick Hunt commented on ZOOKEEPER-360:
----------------------------------------

fyi it was also flagged due to missing tests. Is this already covered by existing tests?

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Benjamin Reed commented on ZOOKEEPER-360:
-----------------------------------------

+1 core tests failures unrelated to patch

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Benjamin Reed commented on ZOOKEEPER-360:
-----------------------------------------

+1 looks good

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Updated: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira updated ZOOKEEPER-360:
---------------------------------------------

    Status: Patch Available  (was: Open)

Still in the process of trying to please hudson.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Updated: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira updated ZOOKEEPER-360:
---------------------------------------------

    Attachment: ZOOKEEPER-BOOKKEEPER-360.patch

This patch gets rid of the masterKeys WeakHashMap in Bookie.java and adds an attribute to LedgerDescriptor to keep it.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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


[jira] Commented: (ZOOKEEPER-360) WeakHashMap in Bookie.java causes NPE

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

Flavio Paiva Junqueira commented on ZOOKEEPER-360:
--------------------------------------------------

Following the link for test results, it shows that the following caused the error:

java.lang.RuntimeException: java.net.BindException: Address already in use
	at org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer.java:310)
	at org.apache.zookeeper.test.LETest.testLE(LETest.java:103)
Caused by: java.net.BindException: Address already in use
	at java.net.PlainDatagramSocketImpl.bind0(Native Method)
	at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:82)
	at java.net.DatagramSocket.bind(DatagramSocket.java:368)
	at java.net.DatagramSocket.<init>(DatagramSocket.java:210)
	at java.net.DatagramSocket.<init>(DatagramSocket.java:261)
	at java.net.DatagramSocket.<init>(DatagramSocket.java:234)
	at org.apache.zookeeper.server.quorum.QuorumPeer.startLeaderElection(QuorumPeer.java:306)

and this patch doesn't change anything on ZooKeeper either, so the changes here are not the causing the failure.

> WeakHashMap in Bookie.java causes NPE
> -------------------------------------
>
>                 Key: ZOOKEEPER-360
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-360
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Flavio Paiva Junqueira
>            Assignee: Flavio Paiva Junqueira
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-BOOKKEEPER-360.patch
>
>
> We need a strong reference to prevent a key in masterKeys on Bookie.java to be garbage collected.

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