Hi Brian,
the plan looks fine from my perspective! Many thanks! I have a few comments on the items: 1. We were using FileChannel.open(Path,…) to open directories, we never used Files.newByteChannel(Path,…): see https://goo.gl/4wDo41; but I assume they both delegate to the same method and both return a FileChannel instance. So maybe we can just prevent directories from be opened with Files.newByteChannel(). But FileChannel.open() could be documented to also work on Directories. This is just an idea. 2. Thanks! 3. That’s the best of the whole approach. #1 ensures that our current code still works, and this one would be the solution once we “detect” Java 9. We can reflect on new OpenOptions or new methods and include that code asap, once a first impl is available. It will take a long time until our code will require Java 9, but we can support those APIs before (using reflection/MethodHandles/StandardOpenOption.valueOf(“StringValueOfNewOption”)) Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen <http://www.thetaphi.de/> http://www.thetaphi.de eMail: [email protected] From: nio-dev [mailto:[email protected]] On Behalf Of Brian Burkhalter Sent: Monday, May 18, 2015 9:05 PM To: nio-dev Cc: [email protected]; [email protected]; Balchandra Vaidya Subject: Re: Recent Java 9 commit (e5b66323ae45) breaks fsync on directory We have revised our approach to this (pair or trio of) problem(s). The following sequence of actions is proposed. 1. Revert the patch which fixed https://bugs.openjdk.java.net/browse/JDK-8066915, (fs) Files.newByteChannel opens directories for cases where subsequent reads may fail, which instigated the present situation. I will file and post the link to a new Issue for this. 2. Work on a fix for https://bugs.openjdk.java.net/browse/JDK-8080589, (fc) FileChannel.force should use fcntl(F_FULLFSYNC) instead of fsync on OS X. 3. Work on a zero to minimal impact fix for https://bugs.openjdk.java.net/browse/JDK-8080235, (fs) Provide ability to flush all modified buffered data to a permanent storage device. Hopefully the foregoing plan of record shall be to everyone’s satisfaction and will converge to an eventual mutually acceptable, logical solution. Thanks, Brian On May 16, 2015, at 9:48 AM, Robert Muir <[email protected]> wrote: Is it really not possible to revert the change that broke all this?
