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

Make VM_Exit::wait_for_threads_in_native_to_block wait for user threads time configurable

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 22
    • 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.

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

              Created:
              Updated:
              Resolved: