Skip to content

Conversation

@viktorklang-ora
Copy link
Contributor

@viktorklang-ora viktorklang-ora commented Jan 13, 2025

Backport to jdk24 of https://bugs.openjdk.org/browse/JDK-8347274


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Integration blocker

 ⚠️ Issue of type Backport is not allowed for integrations

Issue

  • JDK-8347542: Gatherers.mapConcurrent exhibits undesired behavior under variable delays, interruption, and finishing (Backport - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23068/head:pull/23068
$ git checkout pull/23068

Update a local copy of the PR:
$ git checkout pull/23068
$ git pull https://git.openjdk.org/jdk.git pull/23068/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23068

View PR using the GUI difftool:
$ git pr show -t 23068

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23068.diff

Using Webrev

Link to Webrev Comment

…riable delays, interruption, and finishing

Reviewed-by: alanb
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 13, 2025

👋 Welcome back vklang! A progress list of the required criteria for merging this PR into jdk24 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 13, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 13, 2025
@openjdk
Copy link

openjdk bot commented Jan 13, 2025

@viktorklang-ora The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label Jan 13, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 13, 2025

Webrevs

@AlanBateman
Copy link
Contributor

Did you use "/backport" or is this a manual back port?

@viktorklang-ora
Copy link
Contributor Author

@AlanBateman I did a manual backport since there was a merge conflict (on the copyright notice change).

@He-Pin
Copy link
Contributor

He-Pin commented Jan 13, 2025

Does this fix the OOM problem?

import java.util.stream.Gatherers;
import java.util.stream.IntStream;

/**
 * TODO: description of this file
 *
 * @author 虎鸣
 */
public class Main {
    public static void main(String[] args) {
        final var stream = IntStream.range(0, Integer.MAX_VALUE);
        stream.boxed()
            .gather(Gatherers.mapConcurrent(
                2,
                i -> {
                    if (i == 0) {
                        try {
                            Thread.sleep(Integer.MAX_VALUE);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    }
                    return i;
                }))
            .forEach(System.out::println);
        try {
            Thread.sleep(Integer.MAX_VALUE);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}

@viktorklang-ora
Copy link
Contributor Author

Opening a new PR as something didn't go right with this manual backport.

@viktorklang-ora
Copy link
Contributor Author

@He-Pin I believe it will, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants