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

Task terminators do not complete termination in consistent state

XMLWordPrintable

    • gc
    • b06

        Assertion in ParallelTaskTerminator::reset_for_reuse() suggests that terminator should complete termination in consistent state. e.g. _offered_termination == _n_threads for "succeeded termination" or _offered_termination == 0 for "aborted termination"

        Newly upstreamed OWST task terminator has a rare race window that results it to terminate in bad state.

        When termination carries TerminatorTerminator, and its decision (TerminatorTerminator::should_exit_termination) depends on external condition, the race window could result some workers see "succeeded termination", while others see "aborted termination". The workers see "succeeded termination" do not decrease _offered_termination count, while the others, who see "aborted termination", do, that leaves 0 < _offered_termination < _n_threads.

        The inconsistent state is due to spin master detecting termination condition outside lock.

        This bug is not fatal in any means, since when TerminatorTerminator::should_exit_termination() returns true, it usually means to abort the termination, but it can trigger assertion failure in reset_for_reuse() method.

        We did not encounter this bug in Shenandoah for so long, because we use Terminator as the way it was defined, a stack object, we don't reuse them.

              zgu Zhengyu Gu
              zgu Zhengyu Gu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: