Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274315

JFR: One closed state per file or stream

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr
    • Resolved In Build:
      b30

      Backports

        Description

        Numerous JFR streaming tests have timed out sporadically, for example TestOnEvent. One possible reason for the timeouts could be the closed state of a stream not being propagated.

        When a user calls EventStream::close(), both the ChunkParser and the underlying stream, for example RecordingStream, must be closed. Today this is handled by a volatile boolean field in both the stream class and the ChunkParser class. When a new chunk is being parsed, a new instance of the ChunkParser is instantiated with the closed field set to false.

        There is a potential risk that the call EventStream::close() can happen on an old instance of the ChunkParser which could leave the parser thread stuck in ChunkParser::awaitUpdatedHeader(...) waiting for the closed state being true.

        The solution is to have one closed state per recording file or stream. This can be implemented using an AtomicBoolean that is instantiated once and passed around. When it is flipped, it will be seen by all the subsystems.

        If it turns out that timeouts in tests disappear after this bug has been fixed, those test bugs can be closed as duplicates. If not, something else is going on that needs further investigation.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: