JDK-8152085 : (ch) RandomAccessFile.getChannel().lock() is uninterruptible
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-03-17
  • Updated: 2018-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
The test case is in the attachment section
I test it in
  java version "1.8.0_76-ea"
  Java(TM) SE Runtime Environment (build 1.8.0_76-ea-b04)
  Java HotSpot(TM) 64-Bit Server VM (build 25.76-b04, mixed mode)

java -classpath bin -Dsubprocess.classpath=C:/space/jvm.28/misc/bin jazz103.pr109401.UninterruptableLock

The output:

Starting process: java -classpath C:\\Joshua\\task\\PR109401\\eclipse_ws\\test\\bin jazz103.pr109401.UninterruptableLock C:\Users\IBM_AD~1\AppData\Local\Temp\lock-5087312412291950334.tmp
helper process: lock hold time expired
[Thread-0] I/O error: (java.nio.channels.FileLockInterruptionException) null
Interrupt took too long (28.305 seconds).
Waited too long (28.316 seconds).
Done.

"Interrupt took too long (28.305 seconds) " is in the output , because the lock() was not interruptted
Comments
Archived at http://cr.openjdk.java.net/~bpb/8152085/webrev.01/ an equivalent change to that previously posted for review except that all implementation code changes are effected in Windows-specific Java code without any changes to native code.
06-02-2017

Stopping work for now in the JDK 9 time frame pursuant to the P3->P4 priority reduction.
27-01-2017

Review thread: http://mail.openjdk.java.net/pipermail/nio-dev/2017-January/004098.html
26-01-2017

Adding a modified version of UninterruptableLock.java. The original version is incorrect and admits to intermittent failures. The problem is that not enough time is allowed for the helper Process to start and to acquire the lock before the helper Thread is spawned. The updated version instead has the helper Process create a specific file of which the test checks the existence prior to spawning the helper Thread. This modified version of the test fails consistently, i.e., the helper Thread cannot be interrupted during the lock() invocation.
20-01-2017

Linking JI-9032525 as a precaution. That incident was resolved as "Not an Issue" based on information subsequently provided to me via e-mail by the original external submitted who requested that it be withdrawn.
22-03-2016