Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8196536

Remove support for pre-Java 6 non-JVM-wide file locking

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 11
    • core-libs
    • None
    • behavioral
    • minimal
    • Hide
      Applications which set sun.nio.ch.disableSystemWideOverlappingFileLockCheck to rely on broken JDK 1.4/5 behavior may see java.nio.channels.OverlappingFileLockExceptions. This will occur for example when two channels are open on the same file, a lock is obtained on a range via one channel, and an attempt is made to obtain an overlapping lock via the other channel.
      Show
      Applications which set sun.nio.ch.disableSystemWideOverlappingFileLockCheck to rely on broken JDK 1.4/5 behavior may see java.nio.channels.OverlappingFileLockExceptions. This will occur for example when two channels are open on the same file, a lock is obtained on a range via one channel, and an attempt is made to obtain an overlapping lock via the other channel.
    • System or security property
    • JDK

      Summary

      Remove the compatibility knob introduced by CCC-6332756 in JDK 6 to configure the FileChannel/FileLock API to support JDK 1.4/5 behavior for cases where different FileChannels in the same VM attempt to lock an overlapping region of a file.

      Problem

      Prior to JDK 6 when a file lock was requested the check of whether the requested lock overlaps an existing file lock was performed only with respect to the locks obtained on the channel. According to the specification however the check should be JVM-wide, against all channels open on the channel's file across the entire JVM. Checking of locks JVM-wide was added as the default behavior in Java 6 along with a system property to enable the old behavior if so desired. This old behavior is now long obsolete and support for it should be removed.

      Solution

      Remove support for the system property sun.nio.ch.disableSystemWideOverlappingFileLockCheck.

      Specification

      There is no specification change per se, but the removal of the sun.nio.ch.disableSystemWideOverlappingFileLockCheck property will be documented in a release note.

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Alan Bateman, Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: