RFR: 6539707: (fc) MappedByteBuffer.force() method throws an IOException in a very simple test
Brian Burkhalter
bpb at openjdk.java.net
Fri Feb 19 16:40:42 UTC 2021
On Fri, 19 Feb 2021 09:07:39 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> This change proposes to increase the number of retries of `FlushViewOfFile` in the Windows native implementation of `MappedByteBuffer.force()`, and to catch any exception thrown by the native `force()` and rethrow an `UncheckedIOException` with cause set to the intercepted exception. A sentence is added to the specification of `MappedByteBuffer.force()` regarding unspecified errors. The test from the issue description is revised to fail if `force()` throws an exception which is not an `UncheckedIOException`, or if it is an `UncheckedIOException` whose message indicates it was thrown by the Windows native implementation of `force()`.
>
> src/java.base/windows/native/libnio/MappedMemoryUtils.c line 79:
>
>> 77: break;
>> 78: retry++;
>> 79: } while (retry < 5);
>
> This retry is a workaround for what we think is a bug in Windows. I remember there was speculation that it was something to do with the NTFS transaction log being full. It would be useful if get a comment from someone from Microsoft on this.
A full transaction log was indeed a speculation logged in the issue's comments.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2636
More information about the nio-dev
mailing list