Make VM_Exit::wait_for_threads_in_native_to_block wait for user threads time configurable

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: 22
    • Component/s: hotspot
    • b26
    • generic
    • generic

      When the JVM is exiting, VM_Exit::wait_for_threads_in_native_to_block() waits for maximum 300ms if there are any user threads running in native (potentially doing clean-ups). Developer had noticed shutdown delay due to the wait in certain cases and reported the issue on JDK 11.

      As user threads must go through native to Java/VM transitions to access VM data, and they will be stopped during the transition if the VM is shutting down. I think the wait with timeout for user thread in VM_Exit::wait_for_threads_in_native_to_block is not really necessary. Particularly in container environments, VM shutdown could be proceeded 'safely' without waiting for user threads in this case. It would be a good idea to make the wait time configurable.

            Assignee:
            Jiangli Zhou
            Reporter:
            Jiangli Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: