You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "David Latorre (JIRA)" <ji...@apache.org> on 2009/04/13 10:52:14 UTC

[jira] Created: (FTPSERVER-289) Implement locking mechanism for files.

Implement locking mechanism for files.
--------------------------------------

                 Key: FTPSERVER-289
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-289
             Project: FtpServer
          Issue Type: New Feature
          Components: Core
    Affects Versions: 1.0.0
            Reporter: David Latorre
             Fix For: WISHLIST



In order to solve FTPSERVER-288 , this is, to prevent the possibility of race conditions in STOU command  ( it is possible that non-unique filenames be generated with the current implementation) we would eventually need that there was some file locking mechanism which might be a mechanism to keep track of in-use files.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (FTPSERVER-289) Implement locking mechanism for files.

Posted by David Latorre <dv...@gmail.com>.
Hello Sai,

 Actually they don't, if you have access to a unix box you can check
yourself that  it is possible to e.g, move a file which is being
currently written.
 It is windows systems that do prevent concurrent access to files
being written - I don't know  about other OSes.

 With FileChannel lock() or tryLock() you can enforce the OS to lock
files, but still we probably cannot depend on the user using a 'real
filesystem'. For example, we cannot use File.createTempFile() in STOU
because the user could be persisting to a database, to  a VFS
filesystem, to HDFS ...

Still, my question here is: Should we provide an abstraction for file
locking or allow the  filesystem implementation to deal with it
internally?






2009/4/16 Sai Pullabhotla <sa...@jmethods.com>:
> I believe all operating systems handle the file locking on files to prevent
> concurrent writing. So, if more than one users/sessions try to write to the
> same file, who ever opens the file first for writing would win and the rest
> would fail. So not sure if we need to implement what you have mentioned.
>
> Thanks.
>
> Sai Pullabhotla
> Phone: (402) 408-5753
> Fax: (402) 408-6861
> www.jMethods.com
>
>
>
> On Mon, Apr 13, 2009 at 3:52 AM, David Latorre (JIRA) <ji...@apache.org>wrote:
>
>> Implement locking mechanism for files.
>> --------------------------------------
>>
>>                 Key: FTPSERVER-289
>>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-289
>>             Project: FtpServer
>>          Issue Type: New Feature
>>          Components: Core
>>    Affects Versions: 1.0.0
>>            Reporter: David Latorre
>>             Fix For: WISHLIST
>>
>>
>>
>> In order to solve FTPSERVER-288 , this is, to prevent the possibility of
>> race conditions in STOU command  ( it is possible that non-unique filenames
>> be generated with the current implementation) we would eventually need that
>> there was some file locking mechanism which might be a mechanism to keep
>> track of in-use files.
>>
>>
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>

Re: [jira] Created: (FTPSERVER-289) Implement locking mechanism for files.

Posted by Sai Pullabhotla <sa...@jmethods.com>.
I believe all operating systems handle the file locking on files to prevent
concurrent writing. So, if more than one users/sessions try to write to the
same file, who ever opens the file first for writing would win and the rest
would fail. So not sure if we need to implement what you have mentioned.

Thanks.

Sai Pullabhotla
Phone: (402) 408-5753
Fax: (402) 408-6861
www.jMethods.com



On Mon, Apr 13, 2009 at 3:52 AM, David Latorre (JIRA) <ji...@apache.org>wrote:

> Implement locking mechanism for files.
> --------------------------------------
>
>                 Key: FTPSERVER-289
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-289
>             Project: FtpServer
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: David Latorre
>             Fix For: WISHLIST
>
>
>
> In order to solve FTPSERVER-288 , this is, to prevent the possibility of
> race conditions in STOU command  ( it is possible that non-unique filenames
> be generated with the current implementation) we would eventually need that
> there was some file locking mechanism which might be a mechanism to keep
> track of in-use files.
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>