JFR: Unclear exception message when dumping stopped in memory recording

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 20
    • Affects Version/s: 11, 17, 19
    • Component/s: hotspot
    • None
    • jfr
    • b18

      try (Recording r = new Recording()) {
         r.setToDisk(false);
         r.start();
         r.stop()
         r.dump(Path.of("recording.jfr"));;
      }

      results in:

      Exception in thread "main" java.io.IOException: Unexpected error during I/O operation
      at jdk.jfr.internal.WriteableUserPath.doPrivilegedIO(WriteableUserPath.java:139)
      at jdk.jfr.internal.PlatformRecording.dumpStopped(PlatformRecording.java:714)
      at jdk.jfr.internal.PlatformRecording.dump(PlatformRecording.java:707)
      at jdk.jfr.Recording.dump(Recording.java:388)
      at Name.main(Name.java:16)

      Problem is that JFR tries to make a dump file, but there are no chunks in the repository since it's an in memory recording. Documentation should make it clear under what circumstances it's possible to dump a recording. The error message should be changed so user understands why it fails.

            Assignee:
            Erik Gahlin
            Reporter:
            Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: