You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Davide Giannella (JIRA)" <ji...@apache.org> on 2017/09/29 10:10:07 UTC
[jira] [Closed] (OAK-6693) Ensure that IndexNodeManager releases
lock in case of error in acquiring it
[ https://issues.apache.org/jira/browse/OAK-6693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Giannella closed OAK-6693.
---------------------------------
Bulk close for 1.7.8
> Ensure that IndexNodeManager releases lock in case of error in acquiring it
> ---------------------------------------------------------------------------
>
> Key: OAK-6693
> URL: https://issues.apache.org/jira/browse/OAK-6693
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: lucene
> Reporter: Chetan Mehrotra
> Assignee: Chetan Mehrotra
> Priority: Minor
> Fix For: 1.8, 1.7.8, 1.6.6
>
>
> Currently IndexNodeManager acquires the lock like below. Here if any exception occurs in IndexNodeImpl then lock would remain acquired
> {noformat}
> IndexNode acquire() {
> lock.readLock().lock();
> if (closed) {
> lock.readLock().unlock();
> return null;
> } else {
> boolean success = false;
> try {
> refreshPolicy.refreshOnReadIfRequired(refreshCallback);
> success = true;
> return new IndexNodeImpl(searcherHolder);
> } finally {
> if (!success) {
> lock.readLock().unlock();
> }
> }
> }
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)