ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Duffy (Indeed.com) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IVY-1424) NIO FileLocker releases locks while still within tryLock() call
Date Thu, 20 Jun 2013 21:18:21 GMT
Charles Duffy (Indeed.com) created IVY-1424:
-----------------------------------------------

             Summary: NIO FileLocker releases locks while still within tryLock() call
                 Key: IVY-1424
                 URL: https://issues.apache.org/jira/browse/IVY-1424
             Project: Ivy
          Issue Type: Bug
            Reporter: Charles Duffy (Indeed.com)
         Attachments: ivy-nio-locker-fix.diff

The notes about NIOFileLocker being deprecated due to unreliability have an obvious cause
-- locks it grabs have already been released before the tryLock method has even exited due
to the finally block closing the file descriptor on which the lock is held!

(flock() or fcntl()-based locks, into one of which categories those created by NIO fall on
modern Unixlike operating systems, are implicitly closed whenever the file handle on which
they're held exits. This is highly desirable behavior, because it means that a lock is implicitly
cleared on unclean shutdown of any sort -- power failure, SIGKILL to the JVM, etc; this behavior
is also perhaps the primary reason to prefer NIO locks to the approach taken by CreateFileLocker).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message