-
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
Fix retry() race conditions #2997
Conversation
To induce failure I run this in a loop: ./gradlew -i -Dtest.single=OperatorRetry cleanTest test On Ubuntu 14.04 64-bit i7 i7 CPU 920 @ 2.67GHz × 8, home desktop, java 1.8u45: ? tested with wrong branch version, testing again ! On Ubuntu 14.04 64-bit i5 CPU U 470 @ 1.33GHz × 4, laptop, java 1.8u45: 238th run:
|
I still don't understand the cause of the failure. The best thing we can do is to increase that await timeout in the test to 5-7 seconds because this seems to be some transient hiccup rather than a hang. Otherwise, support this PR but defer the judgement to @benjchristensen . |
removed last comment, ran on wrong branch |
I bumped up await timeout to 5 minutes and the 54th run failed in 5 mins 9.9 seconds (on home desktop): rx.internal.operators.OperatorRetryTest > testRetryWithBackpressureParallel FAILED
java.lang.AssertionError: Data content mismatch: 950={beginningEveryTime x 136}
at org.junit.Assert.fail(Assert.java:93)
at rx.internal.operators.OperatorRetryTest.testRetryWithBackpressureParallel(OperatorRetryTes
t.java:768) 5 minutes is a long time for some OS hiccup and makes me think that the freeze is occurring because of our code. I'll run another test and dump all threads after the freeze. |
Then we need a full rewrite, but I don't have time for it for at least 3 months. |
Thread dump after freeze occuring on 84th run on home desktop:
|
At the moment I don't suspect problems with the
I've been looking elsewhere and now my suspicions lie with the gradle infrastructure. I believe the tests for This is an unusual case inasmuch as we don't normally rely on tests looping on gradle tests but rather run loops in a single JVM. A fresh JVM can sometimes expose race conditions that aren't as easily exposed by a warmed-up JVM but I think this is being pushed a bit far and might be exposing us to rarely encountered gradle bugs too. I think |
I think it is as good as it can get for now. I think we can return to the case when we port things over to RxJava 2.0. Thanks! |
This is the continuation of #2930 with a rebased PR.
There are sporadic testing failures with this PR so not ready for merge. I'll note some failures with this one soon.