RFR 8166253: (ch) FileLock object can get GC'd and result in unexpected release of file lock
brian.burkhalter at oracle.com
Tue Jan 30 01:23:31 UTC 2018
This is a continuation of the discussion about  which trailed off with .
According to :
"A file-lock object is initially valid. It remains valid until the lock is released by invoking the release method, by closing the channel that was used to acquire it, or by the termination of the Java virtual machine, whichever comes first."
The problem described in the issue occurs when a FileLock is obtained and subsequently becomes unreachable and is collected before the underlying native lock has been released (either explicitly or by closing the channel). In this case an attempt to obtain an overlapping lock should still be rejected in order to satisfy the foregoing specification, namely “[…] or by the termination of the Java virtual machine.”
The proposed fix is:
On Nov 8, 2016, at 6:44 AM, Daniel Fuchs <daniel.fuchs at oracle.com> wrote:
> As for whether that's the most appropriate fix for the
> issue, then maybe the regular nio Reviewers will chime in :-)
> best regards,
> -- daniel
> On 07/11/16 22:13, Brian Burkhalter wrote:
>> I have updated the patch to include the suggested changes:
>> The pertinent regression tests still pass.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev