jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-6193) IllegalStateException when closing the FileStore during garbage collection
Date Wed, 20 Sep 2017 12:31:00 GMT

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

Michael Dürig commented on OAK-6193:
------------------------------------

I think the patch conceptionally implements the right approach. However I would prefer to
encapsulate these life cycle management concerns in a dedicated class so not to pollute the
rest of the code with all those {{throw new ISE}} etc. statements. That dedicated class should
encapsulate the {{shutdown}} and the {{shutdownComplete}} flags as well as the {{shutdownLock}}.
The latter could then even be acquired / released using the "try with resource" syntax. Something
along the lines of 

{code}
void foo() {
        try (ShutDownLock l = lifeCycle.keepAlive()) {
            // file store access code here
        }
}
{code}

and 

{code}
void close() {
        try (ShutDownLock l = lifeCycle.shutDown()) {
            // file store close code here
        }
}
{code}


> IllegalStateException when closing the FileStore during garbage collection
> --------------------------------------------------------------------------
>
>                 Key: OAK-6193
>                 URL: https://issues.apache.org/jira/browse/OAK-6193
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Michael Dürig
>            Assignee: Francesco Mari
>              Labels: gc
>             Fix For: 1.8, 1.7.8
>
>         Attachments: OAK-6193-01.patch
>
>
> When the file store is shut down during gc compaction is properly aborted. Afterwards
it will trigger a cleanup cycle though, which runs concurrently to the proceeding shutdown
potentially causing an {{ISE}}:
> {noformat}
> at com.google.common.base.Preconditions.checkState(Preconditions.java:134)
> at org.apache.jackrabbit.oak.segment.file.TarWriter.close(TarWriter.java:333)
> at org.apache.jackrabbit.oak.segment.file.TarWriter.createNextGeneration(TarWriter.java:376)
> at org.apache.jackrabbit.oak.segment.file.FileStore.newWriter(FileStore.java:682)
> at org.apache.jackrabbit.oak.segment.file.FileStore.access$1700(FileStore.java:100)
> at org.apache.jackrabbit.oak.segment.file.FileStore$GarbageCollector.cleanup(FileStore.java:1069)
> at org.apache.jackrabbit.oak.segment.file.FileStore$GarbageCollector.cleanupGeneration(FileStore.java:1195)
> at org.apache.jackrabbit.oak.segment.file.FileStore$GarbageCollector.run(FileStore.java:803)
> at org.apache.jackrabbit.oak.segment.file.FileStore.gc(FileStore.java:387)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message