[
https://issues.apache.org/jira/browse/LUCENE-6508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14566743#comment-14566743
]
Robert Muir commented on LUCENE-6508:
-------------------------------------
{quote}
I wonder if we even need to pass a lock name anymore? Maybe it can
just be Directory.obtainWriteLock()?
{quote}
I thought about this too, but for a number of reasons I dislike it:
* leave the possibility of other locks for other purposes if we need them.
* major conceptual "break" for any code using it today.
* makes backwards compat/5.x impossible.
On the other hand, with the current situation, i could see this stuff in a 5.3
release. The breaks are contained, locking is marked lucene.internal already
anyway. And we could even add more back compat if we really really need it
(e.g. add back Dir.makeLock deprecated with some wrapper over the now simpler
api).
I think its important that if make this kind of thing better, we get it out
there... I made a lot of compromises to do this! I added back the specialized
exceptions, I added sleepinglockfactory, added back IWconfig timeout, even
enabled that by default (we can discuss somewhere). I even added back the
horrible IndexWriter.isLocked, with big scary warnings:
{code}
* @deprecated Use of this method can only lead to race conditions. Try
* to actually obtain a lock instead.
*/
@Deprecated
public static boolean isLocked(Directory directory) throws IOException {
{code}
To me its worth the trouble...
> Simplify Directory/lock api
> ---------------------------
>
> Key: LUCENE-6508
> URL: https://issues.apache.org/jira/browse/LUCENE-6508
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Assignee: Uwe Schindler
> Attachments: LUCENE-6508-deadcode1.patch, LUCENE-6508.patch,
> LUCENE-6508.patch
>
>
> See LUCENE-6507 for some background. In general it would be great if you can
> just acquire an immutable lock (or you get a failure) and then you close that
> to release it.
> Today the API might be too much for what is needed by IW.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]