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

(fs) introduce system property to choose WatchService on macOS

    XMLWordPrintable

Details

    • CSR
    • Resolution: Unresolved
    • P4
    • tbd
    • core-libs
    • None
    • behavioral
    • minimal
    • Minimal risk as this is a client property that has never been used before and its name is used on macOS only.
    • System or security property
    • JDK

    Description

      Summary

      Control which implementation of WatchService is used on macOS.

      Problem

      The existing WatchService implementation on macOS has its limitations, but it is quite stable and has characteristics users have become accustomed to over the years. The new FSEvents-based implementation, while providing much better performance, introduces a risk of new bugs and certainly changes the expected characteristics, which may not be desirable for every user.

      Solution

      Instead of simply replacing the existing implementation with a new one, it is proposed to provide an opt-in new implementation with the help of a system property. This way, users not wishing to switch to the new implementation are not affected by the change and those willing to give the new implementation a try can do so with ease. Over time, the default may be re-considered in favor of the new FSEvents-based implementation.

      Specification

      FileSystem::newWatchService returns an object of class MacOSXWatchService if System.getProperty("sun.nio.fs.MacOSXWatchService.use") returns non-null value and an object of class PollingWatchService otherwise (the status quo).

      Attachments

        Issue Links

          Activity

            People

              mkartashev Maxim Kartashev
              mkartashev Maxim Kartashev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: