-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Thread running otherSingleSource of a timeout is interrupted before running #5169
Comments
Hi. It is possible but I can't really read Groovy/Spock code. The resolution could be to remove the set and have the individual Disposables there. PR welcome (also check of Maybe is needed as well). |
Hi @janbols, I have tried running your Spock speck in a fresh project with just a dependency to This is weird, and the only thing that you might be running something before this spec that might impact this. Could you provide more info? |
PR #5207 should resolve this case as well. |
Excellent. Indeed that would solve it. Thanks |
I am new to spock so I missed that! Thanks @janbols for the clarification! |
@janbols RxJava 2.0.8 has been released with fixes to the schedulers. Could you verify the issue is resolved for you? |
Hi @akarnokd , Thanks for all the work. I'll close the issue. |
Hi, I'm running
io.reactivex.rxjava2:rxjava:2.0.6
.When doing the following, the thread running the otherSingleSource has its interrupted flag set. This throws
java.lang.InterruptedException
s. Below, you can find an example:The thread that runs
return Long.MAX_VALUE
is interrupted. You can find a unit test using spock on https://gist.github.com/janbols/e97ceb349641f58895379ff562aab59bThe same effect is observed when we call
timeout
with an explicit scheduler. The only way I could make this working is by subscribing the otherSingleSource on another thread like the following:I tried to debug the code and I think it has something to do with the call to
set.clear()
inside the runnable when the timer expires inio.reactivex.internal.operators.single.SingleTimeout#subscribeActual
. At that timeset
contains thetimer
disposable and by clearing it, you're also interrupting the thread that's running the task inio.reactivex.internal.schedulers.ScheduledRunnable#dispose
.Of course I could be completely wrong as well since thread scheduling isn't really my cup of tea :-).
The text was updated successfully, but these errors were encountered: