Class FileLockNamedLockFactory

    • Field Detail

      • SYSTEM_PROP_DELETE_LOCK_FILES

        public static final java.lang.String SYSTEM_PROP_DELETE_LOCK_FILES
        Tweak: on Windows, the presence of StandardOpenOption#DELETE_ON_CLOSE causes concurrency issues. This flag allows to have it removed from effective flags, at the cost that lockfile directory becomes crowded with 0 byte sized lock files that are never cleaned up. Default value is true on non-Windows OS. See JDK-8252883 for Windows related bug. Users on Windows can still force "delete on close" by explicitly setting this property to true.
        See Also:
        JDK-8252883, Constant Field Values
      • SYSTEM_PROP_ATTEMPTS

        public static final java.lang.String SYSTEM_PROP_ATTEMPTS
        Tweak: on Windows, the presence of StandardOpenOption#DELETE_ON_CLOSE causes concurrency issues. This flag allows to implement similar fix as referenced JDK bug report: retry and hope the best. Default value is 5 attempts (will retry 4 times).
        See Also:
        JDK-8252883, Constant Field Values
      • SYSTEM_PROP_MAX_CACHED_CHANNELS

        public static final java.lang.String SYSTEM_PROP_MAX_CACHED_CHANNELS
        Maximum number of idle (not currently locked) FileChannels to keep open for reuse. Keeping channels open avoids repeated open/creat syscalls, but each open channel consumes a file descriptor. On systems with low FD limits (e.g., macOS defaults to 256), large reactor builds with thousands of unique artifacts can exhaust the limit. This cap bounds idle channel retention; channels for actively held locks are never evicted.
        See Also:
        Constant Field Values