-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Non deterministic test: OperatorRetryTest.testRetryWithBackpressureParallel #2863
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
Comments
This should be fixed now. |
Not yet: java.lang.AssertionError: Data content mismatch: 1465={beginningEveryTime}
at org.junit.Assert.fail(Assert.java:93)
at rx.internal.operators.OperatorRetryTest.testRetryWithBackpressureParallel(OperatorRetryTest.java:763) |
@akarnokd can you reopen this issue please |
Still seeing this failure 50% of the time:
|
I've tried reproducing this error but it never happened. I've run the test 10k times, played with CPU affinity and other thread disruptions to no avail. |
Have you got an oldish i5 dual core to try it on? I'll have a look at the On Mon, 27 Apr 2015 21:53 David Karnok [email protected] wrote:
|
I've tried on a Core 2 Duo E6600 running Windows 7 32 bit and no failure. |
I've been poking around in |
I'd wish I understood I wanted to rewrite the entire operator but I don't understand the protocol for the supplied |
Sorry that part isn't documented as well. There is a race condition when the observable of restarts is subscribed to and the redo is initiating the first subscribe. The isLocked is to ignore the onNexts from output observable until an onNext sent in to the input. |
The first message was from my phone so it might not make as much sense as I hoped. @davidmoten The problem is that this code has to protect itself from the arbitrary code that can exist in the function. The implementations fall into two buckets those that use the This led us to the question: What should initiate the first subscription to the source Observable? If the first subscription is to be initiated by the Observable returned by the function then user functions that doesn't use scan would never start but if Redo initiates the first subscription then functions that use scan will subscribe twice immediately. The path we picked was to make the Redo do the initial subscribe. We didn't want operator to easily fail to do what was expected if there was a misunderstanding in how the user was supposed to write their function to have a scan in it. We handled the double initial subscriptions by not letting them re-subscribe until the initial subscription had completed (aka isLocked). @akarnokd maybe it would make more sense if it was broken down a bit. The onNext from the Observable returned from the function are mapped to a re-subscription of the source observable. The cool thing about using the onNext as the trigger for re-subscription is that there are many temporal operators to facilitate batching or delaying onNexts. onError and onCompleted are sent as is downstream. The input to the function is the Observable of terminal |
Thanks @abersnaze, that helps my understanding a little bit. Stuff like that would be a great addition to the comments in this class when we get it working. |
Given that the test fails reliably (for me) and concerns backpressure in an asynchronous situation I'm assuming there is a race condition associated with the child.setProducer(new Producer() {
@Override
public void request(final long n) {
long c = BackpressureUtils.getAndAddRequest(consumerCapacity, n);
Producer producer = currentProducer.get();
if (producer != null) {
producer.request(n);
} else
if (c == 0 && resumeBoundary.compareAndSet(true, false)) {
worker.schedule(subscribeToSource);
}
}
}); |
The resubscription only happens after the previous subscription to the source has terminated with an onError/onCompleted so isn't much need for locking. |
Is this still an issue? Or did the change in #2930 fix things? |
@davidmoten Could you try your machine with 2.x? |
Will do On Fri, 11 Sep 2015 22:31 David Karnok [email protected] wrote:
|
I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one. |
This fails for me 5 out of 10 times when I run all tests in
OperatorRetryTest
in Eclipse on a fast machine.Here's the stack trace:
The text was updated successfully, but these errors were encountered: