[jira] [Commented] (BOOKKEEPER-568) NPE during GC with HierarchicalLedgerManager

2013-02-14 Thread Sijie Guo (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13578941#comment-13578941
 ] 

Sijie Guo commented on BOOKKEEPER-568:
--

committed as r1446445 in branch 4.2.1.

 NPE during GC with HierarchicalLedgerManager
 

 Key: BOOKKEEPER-568
 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-568
 Project: Bookkeeper
  Issue Type: Bug
  Components: bookkeeper-server
Affects Versions: 4.2.0
Reporter: Matteo Merli
Assignee: Matteo Merli
Priority: Minor
 Fix For: 4.3.0, 4.2.1

 Attachments: 
 0001-BOOKKEEPER-568-NPE-during-GC-with-HierarchicalLedger.patch


 {noformat}
 2013-02-11 14:06:28,904 - WARN  - 
 [GarbageCollectorThread:ScanAndCompareGarbageCollector@103] - Exception when 
 iterating over the metadata {}
 java.io.IOException: Error when check more elements
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:423)
   at 
 org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:75)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:302)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:271)
 Caused by: java.lang.NullPointerException
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:419)
   ... 3 more
 {noformat}
 In the code below, l2NodesIter appears to be null.
 {code}
 public boolean hasNext() throws IOException {
try {
   if (l1NodesIter == null) {
   l1NodesIter = zk.getChildren(ledgerRootPath, null).iterator();
   hasMoreElement = nextL1Node();
   } else if (!l2NodesIter.hasNext()) {
   hasMoreElement = nextL1Node();
   }
} catch (Exception e) {
   throw new IOException(Error when check more elements, e);
}
return hasMoreElement;
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (BOOKKEEPER-568) NPE during GC with HierarchicalLedgerManager

2013-02-13 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13577746#comment-13577746
 ] 

Hadoop QA commented on BOOKKEEPER-568:
--

Testing JIRA BOOKKEEPER-568


Patch 
[0001-BOOKKEEPER-568-NPE-during-GC-with-HierarchicalLedger.patch|https://issues.apache.org/jira/secure/attachment/12569214/0001-BOOKKEEPER-568-NPE-during-GC-with-HierarchicalLedger.patch]
 downloaded at Wed Feb 13 16:51:16 UTC 2013



{color:green}+1 PATCH_APPLIES{color}
{color:green}+1 CLEAN{color}
{color:green}+1 RAW_PATCH_ANALYSIS{color}
.{color:green}+1{color} the patch does not introduce any @author tags
.{color:green}+1{color} the patch does not introduce any tabs
.{color:green}+1{color} the patch does not introduce any trailing spaces
.{color:green}+1{color} the patch does not introduce any line longer than 
120
.{color:green}+1{color} the patch does adds/modifies 1 testcase(s)
{color:green}+1 RAT{color}
.{color:green}+1{color} the patch does not seem to introduce new RAT 
warnings
{color:green}+1 JAVADOC{color}
.{color:green}+1{color} the patch does not seem to introduce new Javadoc 
warnings
{color:green}+1 COMPILE{color}
.{color:green}+1{color} HEAD compiles
.{color:green}+1{color} patch compiles
.{color:green}+1{color} the patch does not seem to introduce new javac 
warnings
{color:green}+1 FINDBUGS{color}
.{color:green}+1{color} the patch does not seem to introduce new Findbugs 
warnings
{color:green}+1 TESTS{color}
.Tests run: 817
{color:green}+1 DISTRO{color}
.{color:green}+1{color} distro tarball builds with the patch 


{color:green}*+1 Overall result, good!, no -1s*{color}


The full output of the test-patch run is available at

.   https://builds.apache.org/job/bookkeeper-trunk-precommit-build/268/

 NPE during GC with HierarchicalLedgerManager
 

 Key: BOOKKEEPER-568
 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-568
 Project: Bookkeeper
  Issue Type: Bug
  Components: bookkeeper-server
Affects Versions: 4.2.0
Reporter: Matteo Merli
Priority: Minor
 Attachments: 
 0001-BOOKKEEPER-568-NPE-during-GC-with-HierarchicalLedger.patch


 {noformat}
 2013-02-11 14:06:28,904 - WARN  - 
 [GarbageCollectorThread:ScanAndCompareGarbageCollector@103] - Exception when 
 iterating over the metadata {}
 java.io.IOException: Error when check more elements
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:423)
   at 
 org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:75)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:302)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:271)
 Caused by: java.lang.NullPointerException
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:419)
   ... 3 more
 {noformat}
 In the code below, l2NodesIter appears to be null.
 {code}
 public boolean hasNext() throws IOException {
try {
   if (l1NodesIter == null) {
   l1NodesIter = zk.getChildren(ledgerRootPath, null).iterator();
   hasMoreElement = nextL1Node();
   } else if (!l2NodesIter.hasNext()) {
   hasMoreElement = nextL1Node();
   }
} catch (Exception e) {
   throw new IOException(Error when check more elements, e);
}
return hasMoreElement;
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (BOOKKEEPER-568) NPE during GC with HierarchicalLedgerManager

2013-02-11 Thread Matteo Merli (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13576182#comment-13576182
 ] 

Matteo Merli commented on BOOKKEEPER-568:
-

I'm not sure if doing 
{code}
l2NodesIter == null || !l2NodesIter.hasNext()
{code}

 would be the correct check.

 NPE during GC with HierarchicalLedgerManager
 

 Key: BOOKKEEPER-568
 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-568
 Project: Bookkeeper
  Issue Type: Bug
  Components: bookkeeper-server
Affects Versions: 4.2.0
Reporter: Matteo Merli
Priority: Minor

 {noformat}
 2013-02-11 14:06:28,904 - WARN  - 
 [GarbageCollectorThread:ScanAndCompareGarbageCollector@103] - Exception when 
 iterating over the metadata {}
 java.io.IOException: Error when check more elements
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:423)
   at 
 org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:75)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:302)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:271)
 Caused by: java.lang.NullPointerException
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:419)
   ... 3 more
 {noformat}
 In the code below, l2NodesIter appears to be null.
 {code}
 public boolean hasNext() throws IOException {
try {
   if (l1NodesIter == null) {
   l1NodesIter = zk.getChildren(ledgerRootPath, null).iterator();
   hasMoreElement = nextL1Node();
   } else if (!l2NodesIter.hasNext()) {
   hasMoreElement = nextL1Node();
   }
} catch (Exception e) {
   throw new IOException(Error when check more elements, e);
}
return hasMoreElement;
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (BOOKKEEPER-568) NPE during GC with HierarchicalLedgerManager

2013-02-11 Thread Sijie Guo (JIRA)

[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13576374#comment-13576374
 ] 

Sijie Guo commented on BOOKKEEPER-568:
--

ah, it seems that this code doesn't handle calling hasNext twice. so second 
time call hasNext would fail with null pointer. the case would happened when 
there is no ledgers existed in bookkeeper.

[~merlimat] it is OK to fix as your suggestion. could you generate a patch for 
it? thanks.

 NPE during GC with HierarchicalLedgerManager
 

 Key: BOOKKEEPER-568
 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-568
 Project: Bookkeeper
  Issue Type: Bug
  Components: bookkeeper-server
Affects Versions: 4.2.0
Reporter: Matteo Merli
Priority: Minor

 {noformat}
 2013-02-11 14:06:28,904 - WARN  - 
 [GarbageCollectorThread:ScanAndCompareGarbageCollector@103] - Exception when 
 iterating over the metadata {}
 java.io.IOException: Error when check more elements
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:423)
   at 
 org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:75)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:302)
   at 
 org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:271)
 Caused by: java.lang.NullPointerException
   at 
 org.apache.bookkeeper.meta.HierarchicalLedgerManager$HierarchicalLedgerRangeIterator.hasNext(HierarchicalLedgerManager.java:419)
   ... 3 more
 {noformat}
 In the code below, l2NodesIter appears to be null.
 {code}
 public boolean hasNext() throws IOException {
try {
   if (l1NodesIter == null) {
   l1NodesIter = zk.getChildren(ledgerRootPath, null).iterator();
   hasMoreElement = nextL1Node();
   } else if (!l2NodesIter.hasNext()) {
   hasMoreElement = nextL1Node();
   }
} catch (Exception e) {
   throw new IOException(Error when check more elements, e);
}
return hasMoreElement;
 }
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira