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

Print compilation task before blocking compiler thread for shutdown

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • b11

      JIT compilers in current Hotspot are compiling the code while being in native state. So if there is a running compilation, it does not block shutdown naturally. The shutdown code has cooperative mechanism to coordinate shutdown of compiler threads. Shutdown code sets the `CompilerBroker::should_block`, and compilers are regularly checking it with `CompilerBroker::maybe_block`. When shutdown is pending, the running compiler threads would eventually hit that `maybe_block`, block at transition to VM state, and that would allow shutdown to proceed.

      One of the problems with this mechanism is observability: if compiler thread was running a long-running compilation, nothing would be written in the compilation logs about it. The compilation would just -- poof! -- disappear without a trace. This is arguably against the user expectation: we print _something_ whether the compilation succeeded or failed.

      This kind of shutdown-during-heavy-compilation regularly happens in short runs in Leyden benchmarks. It made me scratch my head for quite a while before I understood where the compilation task went. I would like to add some sort of diagnostics for these cases.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: