jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Mari (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OAK-5223) SegmentNodeStoreService components don't unregister with the blobstore
Date Mon, 05 Dec 2016 15:13:58 GMT

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

Francesco Mari updated OAK-5223:
--------------------------------
    Attachment: OAK-5223-02.patch

[~alex.parvulescu], moving that code to the {{unregisterNodeStore}} method is not a bad idea
at all. Talking about synchronization, the current implementation is not really following
the best practice of not calling into the OSGi framework while holding a lock. I reworked
the patch a bit to make it clear what I mean.

Before calling into the framework - e.g.. directly via {{org.osgi.framework.ServiceRegistration#unregister}}
or indirectly via {{org.apache.jackrabbit.oak.spi.whiteboard.AbstractServiceTracker#stop}}
- I copy every item I have to finalize into a stack variable and update the state of the component
atomically. Finalization code is then invoked on the thread calling {{unregisterNodeStore}}
without any lock held.

The most immediate improvement of this code would be to encapsulate every {{unregister}},
{{stop}} and {{close}} method into its own {{Closeable}}, and delegate the cleanup to a {{com.google.common.io.Closer}}
to make sure that every resource is released properly even in case of error.

> SegmentNodeStoreService components don't unregister with the blobstore
> ----------------------------------------------------------------------
>
>                 Key: OAK-5223
>                 URL: https://issues.apache.org/jira/browse/OAK-5223
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Alex Parvulescu
>            Assignee: Alex Parvulescu
>             Fix For: 1.6, 1.5.15
>
>         Attachments: OAK-5223-02.patch, OAK-5223.patch
>
>
> There are a few components in the SegmentNodeStoreService ({{store}}, {{segmentNodeStore}},
{{gcMonitor}} and {{observerTracker}}) that aren't unregistered when the blobStore unregisters.
So in the case of a blobStore unregister/register situation, they will be recreated but the
old ones will not be closed properly.
> [edit] added all components that have a leak problem when the blob store binds/unbinds.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message