-
Bug
-
Resolution: Fixed
-
P3
-
11, 13
-
b18
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8246064 | 13.0.4 | Chihiro Ito | P3 | Resolved | Fixed | b03 |
JDK-8235677 | 11.0.7-oracle | Chihiro Ito | P3 | Resolved | Fixed | b01 |
JDK-8232901 | 11.0.6 | Chihiro Ito | P3 | Resolved | Fixed | b01 |
A DESCRIPTION OF THE PROBLEM :
According to official documentation of FlightRecorderMXBeanImpl, there should be a valid recording option availabe - destination, which specifies the path where recording data is written when the recording stops. However, such an option is not supported in the source code and using this options ends with following exception: IllegalArgumentException("Unknown recording option: destination. Valid options are maxSize, maxAge, name, disk, dumpOnExit, duration)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create flightRecorderMXBean instance
2. long recordingId = flightRecorderMXBean.newRecording();
3. flightRecorderMXBean.setRecordingOptions(recordingId, getPredefinedRecordingOptions());
4. flightRecorderMXBean.setPredefinedConfiguration(recordingId, "profile");
5. flightRecorderMXBean.startRecording(recordingId);
This is what getPredefinedRecordingOptions() returns:
private Map<String, String> getPredefinedRecordingOptions()
{
return new HashMap<>()
{{
put("name", "recording");
put("maxAge", "10 m");
put("maxSize", Long.toString(1024 * 1024 * 1024));
put("dumpOnExit", "true");
put("disk", "true");
put("duration", "3 m");
put("destination", "/recordings/recording.jfr");
}};
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Recording successfully starts
ACTUAL -
Following exception is thrown:
IllegalArgumentException("Unknown recording option: destination. Valid options are maxSize, maxAge, name, disk, dumpOnExit, duration)
CUSTOMER SUBMITTED WORKAROUND :
Use copyTo method in FlightRecorderMXBeanImpl to achieve storing into desired directory and file.
FREQUENCY : always
According to official documentation of FlightRecorderMXBeanImpl, there should be a valid recording option availabe - destination, which specifies the path where recording data is written when the recording stops. However, such an option is not supported in the source code and using this options ends with following exception: IllegalArgumentException("Unknown recording option: destination. Valid options are maxSize, maxAge, name, disk, dumpOnExit, duration)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create flightRecorderMXBean instance
2. long recordingId = flightRecorderMXBean.newRecording();
3. flightRecorderMXBean.setRecordingOptions(recordingId, getPredefinedRecordingOptions());
4. flightRecorderMXBean.setPredefinedConfiguration(recordingId, "profile");
5. flightRecorderMXBean.startRecording(recordingId);
This is what getPredefinedRecordingOptions() returns:
private Map<String, String> getPredefinedRecordingOptions()
{
return new HashMap<>()
{{
put("name", "recording");
put("maxAge", "10 m");
put("maxSize", Long.toString(1024 * 1024 * 1024));
put("dumpOnExit", "true");
put("disk", "true");
put("duration", "3 m");
put("destination", "/recordings/recording.jfr");
}};
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Recording successfully starts
ACTUAL -
Following exception is thrown:
IllegalArgumentException("Unknown recording option: destination. Valid options are maxSize, maxAge, name, disk, dumpOnExit, duration)
CUSTOMER SUBMITTED WORKAROUND :
Use copyTo method in FlightRecorderMXBeanImpl to achieve storing into desired directory and file.
FREQUENCY : always
- backported by
-
JDK-8232901 Destination option missing in FlightRecorderMXBeanImpl
-
- Resolved
-
-
JDK-8235677 Destination option missing in FlightRecorderMXBeanImpl
-
- Resolved
-
-
JDK-8246064 Destination option missing in FlightRecorderMXBeanImpl
-
- Resolved
-