lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6507) Directory#makeLock is trappy (it does not aquire lock, although its name implies) + NativeFSLock.close() has side effects
Date Thu, 28 May 2015 13:04:36 GMT

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

Robert Muir commented on LUCENE-6507:
-------------------------------------

I still don't like that clearLockHeld calls toRealPath() which can throw an exception / does
IO. And we already do this canonicalization to toRealPath in obtain() which is synced, so
i think we can just save it as an instance variable and simplify this further. I will look
into this.

> Directory#makeLock is trappy (it does not aquire lock, although its name implies) + NativeFSLock.close()
has side effects
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-6507
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6507
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Simon Willnauer
>         Attachments: LUCENE-6507.patch
>
>
> the lock API in Lucene is super trappy since the lock that we return form this API must
first be obtained and if we can't obtain it the lock should not be closed since we might ie.
close the underlying channel in the NativeLock case which releases all lock for this file
on some operating systems. I think the makeLock method should try to obtain and only return
a lock if we successfully obtained it. Not sure if it's possible everywhere but we should
at least make the documentation clear here.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message