ForkJoinPool.commonPool() does not reset Thread Locals

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 19
    • Component/s: core-libs
    • None

      With the ForkJoin updates for Java 19, the common pool stopped clearing thread locals.

      If someone relies on this behavior, then it is a semantic change as code which does not manage their TLs properly will be able to observe unexpected values, and values will be retained for longer than expected.

      Java 18: https://github.com/openjdk/jdk/blob/jdk-18%2B37/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java#L841
      Java 19: https://github.com/openjdk/jdk/blob/jdk-19%2B36/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java#L984

            Assignee:
            Doug Lea
            Reporter:
            Viktor Klang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: