Bug 1213280 - ForkJoinPool missing submission of Runnable
Summary: ForkJoinPool missing submission of Runnable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: java-1.8.0-openjdk
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Andrew John Hughes
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-20 08:54 UTC by Stanislav Baiduzhyi
Modified: 2016-05-05 04:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 03:51:17 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Icedtea Bugzilla 2431 None None None Never
Red Hat Bugzilla 1268912 None None None Never
Red Hat Product Errata RHBA-2015:2181 normal SHIPPED_LIVE java-1.8.0-openjdk enhancement update 2015-11-19 07:51:57 UTC

Internal Links: 1268912

Description Stanislav Baiduzhyi 2015-04-20 08:54:23 UTC
Refactoring of ForkJoin, introduced in 8u40, breaks the runnable submission to the thread pool.

Following code finishes immediately on 8u31 and earlier, but never stops on 8u40 and 8u45.

Reproducer code:

import java.util.concurrent.*;
import java.util.concurrent.atomic.*;

public class ForkJoinPoolThrottling {
    public static void main(String[] args) throws Throwable {
        final ForkJoinPool e = new ForkJoinPool(1);
        final AtomicBoolean b = new AtomicBoolean();
        final Runnable setFalse = new Runnable() { public void run() {
            b.set(false);
        }};
        for (int i = 0; i < 100000; i++) {
            b.set(true);
            e.execute(setFalse);
            do {} while (b.get()); // spins forever here
        }
    }
}

Comment 2 Andrew John Hughes 2015-04-20 16:04:58 UTC
Is this:

changeset:   10054:2188a4078a0a
user:        dl
date:        Fri Sep 05 10:54:28 2014 +0200
summary:     8056248: Improve ForkJoin thread throttling

It sounds like something that needs to be raised upstream.

Comment 3 Chris Phillips @ TO 2015-05-25 10:58:51 UTC
http://hg.openjdk.java.net/jdk9/dev/jdk/rev/97a1facbcaaa
I think (at least for jdk8).

Chris

Comment 4 Andrew John Hughes 2015-05-26 02:12:42 UTC
In 8u: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/b51c6914f297

Comment 5 Andrew John Hughes 2015-06-12 16:00:26 UTC
"This resolution should not be used for Red Hat Enterprise Linux bugs."

https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_status

Comment 6 Andrew John Hughes 2015-07-07 13:10:35 UTC
Without patch:

$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)

$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java RH1213280
(stalls)

With patch:

$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java -version
openjdk version "1.8.0_51"
OpenJDK Runtime Environment (build 1.8.0_51-b16)
OpenJDK 64-Bit Server VM (build 25.51-b03, mixed mode)

$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java RH1213280
$ 
(completes)

Comment 11 errata-xmlrpc 2015-11-19 03:51:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2181.html


Note You need to log in before you can comment on or make changes to this bug.