[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289794#comment-13289794
 ] 

Flavio Junqueira commented on BOOKKEEPER-287:
---------------------------------------------

Sounds like a blocker to me, is it right?

My findings so far. It seems to happen in the case that in 
LedgerCacheImpl.grabCleanPage we have that:

# pageCount >= pageLimit
# cleanLedger is empty
# pages is empty

It doesn't sound like a race on cleanLedgers because it is only manipulated in 
grabCleanPages and deleteLedger, both accesses synchronized. Consequently, it 
sounds like an issue with pages. If pages were not empty, then the for loop in 
the "if (cleanLedgers.isEmpty())" would have added elements to cleanLedgers. My 
conclusion is that pages is empty. We remove elements from pages in 
deleteLedger, so I'm wondering if all ledgers have been deleted between the 
first "synchronized(this)" block and outerLoop. If this is the case, the only 
solution I see is to make the whole method synchronized.

I don't know how to reproduce this.


                
> NoSuchElementException in LedgerCacheImpl
> -----------------------------------------
>
>                 Key: BOOKKEEPER-287
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-287
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Flavio Junqueira
>            Priority: Blocker
>             Fix For: 4.1.0, 4.2.0
>
>
> 2012-06-05 16:24:29,596 - WARN  [NIOServerFactory-3181:NIOServerFactory@128] 
> - Exception in server socket loop: /0.0.0.0
> java.util.NoSuchElementException
>         at java.util.LinkedList.getFirst(LinkedList.java:109)
>         at 
> org.apache.bookkeeper.bookie.LedgerCacheImpl.grabCleanPage(LedgerCacheImpl.java:478)
>         at 
> org.apache.bookkeeper.bookie.LedgerCacheImpl.grabLedgerEntryPage(LedgerCacheImpl.java:169)
>         at 
> org.apache.bookkeeper.bookie.LedgerCacheImpl.putEntryOffset(LedgerCacheImpl.java:199)
>         at 
> org.apache.bookkeeper.bookie.InterleavedLedgerStorage.addEntry(InterleavedLedgerStorage.java:109)
>         at 
> org.apache.bookkeeper.bookie.LedgerDescriptorImpl.addEntry(LedgerDescriptorImpl.java:81)
>         at 
> org.apache.bookkeeper.bookie.Bookie.addEntryInternal(Bookie.java:656)
>         at org.apache.bookkeeper.bookie.Bookie.addEntry(Bookie.java:691)
>         at 
> org.apache.bookkeeper.proto.BookieServer.processPacket(BookieServer.java:368)
>         at 
> org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.readRequest(NIOServerFactory.java:310)
>         at 
> org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.doIO(NIOServerFactory.java:208)
>         at 
> org.apache.bookkeeper.proto.NIOServerFactory.run(NIOServerFactory.java:123)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to