Skip to content
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

2.x Calling hasNext() on a disposed blocking iterator hangs forever #6625

Closed
BrynCooke opened this issue Aug 21, 2019 · 2 comments
Closed

2.x Calling hasNext() on a disposed blocking iterator hangs forever #6625

BrynCooke opened this issue Aug 21, 2019 · 2 comments

Comments

@BrynCooke
Copy link

Calling hasNext() on a a blocking iterator never returns if the iterator has been disposed.

Tested on 2.2.11

To reproduce:

Iterator<Integer> iterator = Flowable.fromArray(1, 2, 3).delay(1, TimeUnit.SECONDS).blockingIterable().iterator();

System.out.println("start");
((Disposable)iterator).dispose();
iterator.hasNext(); //Hangs forever
@akarnokd akarnokd added this to the 3.0 milestone Aug 21, 2019
@akarnokd
Copy link
Member

Indeed, if you "hack" into that Iterator it won't work properly as it implementing Disposable is not part of the public intended API. I'll see what I can do about it in 2.x. For 3.x, it probably needs some redesign to work with try-with-resources for example.

@akarnokd
Copy link
Member

Closing via #6626 & #6627.

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

No branches or pull requests

2 participants