JDK-8165675 : Trace event for thread park has incorrect unit for timeout
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-09-08
  • Updated: 2020-04-27
  • Resolved: 2018-12-12
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.
JDK 11 JDK 12 JDK 13 Other
11.0.3-oracleFixed 12 b24Fixed 13Fixed openjdk8u262Fixed
Related Reports
Relates :  
Description
In trace.xml the ThreadPark event has the following timeout definition:
<value type="MILLIS" field="timeout" label="Park Timeout"/>
and the trace code copies the "time" jlong passed to Unsafe::park right into the timeout field in the event.

The problem is that the specification for Unsafe::park is a bit more complex than that.
* If the "isAbsolute" jboolean is true then the interpretation of the "time" parameter should be a "milliseconds since epoch" timestamp.
* If "isAbsolute" is false then the interpretation of the "time" parameter should be a timeout in nanoseconds relative to "now".

The first case appears to require the EPOCHMILLIS type whereas the second case requires the NANOS type so the current implementation is incorrect for any value of "isAbsolute"
Comments
Replacing jdk8u-fix-request with link to JDK-8239140
17-02-2020

RFC: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-January/011063.html
30-01-2020

Fix Request: This bugfix for JFR shall be brought to jdk11u because it's in the Oracle 11.0.3 shipment. As the patch did not apply cleanly, there a new review is done: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-February/000539.html
20-02-2019

I will add the field "until" (which will be in epoch mills) and change the "timeout" field to nanos.
08-12-2018

I don't think label 'sync' is right for this bug. Thread park can be used for synchronization code, sleep() code, delay code, etc.
05-01-2018