Skip to content

Deadlock #6945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adrian-linca opened this issue Apr 4, 2020 · 2 comments · Fixed by #6946
Closed

Deadlock #6945

adrian-linca opened this issue Apr 4, 2020 · 2 comments · Fixed by #6946
Milestone

Comments

@adrian-linca
Copy link

adrian-linca commented Apr 4, 2020

RXJava 3.0.1.
I randomly got into a weird situation where my code entered a deadlock and I don't know why.
I simplified the code and got to the below part which will enter a deadlock and never return.
This seems like a bug, but maybe I'm missing something.
The code:

Observable
    .range(1, 20)
    .flatMap(
            integer -> {
                if (integer % 5 != 0) {
                    return Observable
                            .just(integer);
                }

                return Observable
                        .just(-integer)
                        .observeOn(Schedulers.io());
            },
            false,
            1
    )
    .ignoreElements()
    .blockingAwait();
@akarnokd akarnokd added this to the 3.1 milestone Apr 4, 2020
@akarnokd
Copy link
Member

akarnokd commented Apr 4, 2020

Thanks. It is a bug with the flatMap operator. Until the fix, you can workaround it by applying hide() to the plain just.

@adrian-linca
Copy link
Author

OK, that works, thanks.

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

Successfully merging a pull request may close this issue.

2 participants