[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Kelly updated BOOKKEEPER-324:
----------------------------------

    Attachment: BOOKKEEPER-324.diff

Fix is simple, but i've made a few extra safety changes. 

* the close now synchronizes on the file info cache before doing anything. 
* close clears the file info cache, so that if anything calls anything on the 
LedgerCacheImpl after close, nothing will happen.
* Order of creation of the sync thread and entrylogger were the wrong way 
around. sync thread uses entrylogger, so should only be used after entrylogger 
is initialized. Viceversa for cleanup.
* evictFileInfoIfNecessary didn't necessarily need to sync on fileInfoCache as 
it is only ever called from within a block which is sync. I made it sync 
explicitly so that in future it can't become a problem

The problem here had nothing specific to LedgerCreateDeleteTest. It could have 
happened on any test which shuts down a bookie.

                
> Flakeyness in LedgerCreateDeleteTest
> ------------------------------------
>
>                 Key: BOOKKEEPER-324
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-324
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Uma Maheswara Rao G
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-324.diff, 
> TEST-org.apache.bookkeeper.test.LedgerCreateDeleteTest.xml
>
>
> Fails when running in a loop for about 40 minutes. Failure is a 
> ConcurrentModificationException
> {code}
>   <testcase time="3.018" 
> classname="org.apache.bookkeeper.test.LedgerCreateDeleteTest" 
> name="testCreateDeleteLedgers">
>     <error 
> type="java.util.ConcurrentModificationException">java.util.ConcurrentModificationException
>       at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
>       at java.util.HashMap$EntryIterator.next(HashMap.java:834)
>       at java.util.HashMap$EntryIterator.next(HashMap.java:832)
>       at 
> org.apache.bookkeeper.bookie.LedgerCacheImpl.close(LedgerCacheImpl.java:781)
>       at 
> org.apache.bookkeeper.bookie.InterleavedLedgerStorage.shutdown(InterleavedLedgerStorage.java:73)
>       at org.apache.bookkeeper.bookie.Bookie.shutdown(Bookie.java:644)
>       at org.apache.bookkeeper.bookie.Bookie.shutdown(Bookie.java:630)
>       at 
> org.apache.bookkeeper.proto.BookieServer.shutdown(BookieServer.java:110)
>       at 
> org.apache.bookkeeper.test.BookKeeperClusterTestCase.stopBKCluster(BookKeeperClusterTestCase.java:146)
>       at 
> org.apache.bookkeeper.test.BookKeeperClusterTestCase.tearDown(BookKeeperClusterTestCase.java:94)
>       at junit.framework.TestCase.runBare(TestCase.java:140)
>       at junit.framework.TestResult$1.protect(TestResult.java:110)
> {code}

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