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-7961) SimpleFSLockFactory should catch+box IOException (not FileAlreadyExistsException | AccessDeniedException)
Date Wed, 06 Sep 2017 22:22:00 GMT

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

Robert Muir commented on LUCENE-7961:
-------------------------------------

And to prevent confusion I think the exception should change slightly from:
{code}
throw new LockObtainFailedException("Lock held elsewhere: " + lockFile, e);
{code}

to:

{code}
throw new LockObtainFailedException("Lock held elsewhere or inaccessible: " + lockFile, e);
{code}

Let SimpleFSLockFactory not try to determine what happened, you can determine that from the
caused-by.

> SimpleFSLockFactory should catch+box IOException (not FileAlreadyExistsException | AccessDeniedException)
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-7961
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7961
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>
> SimpleFSLockFactory will only convert {{FileAlreadyExistsException | AccessDeniedException}}
from Files.createFile() into LockObtainFailedException. Neither of these are guaranteed from
the API, only {{IOException}}.
> I think SimpleFSLockFactory should box any IOException from Files.createFile() into a
LockObtainFailedException instead of just these two optional ones. It is simpler and more
consistent behavior, even if its just theoretical problem for some FileSystem impl that doesn't
throw these. 



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

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


Mime
View raw message