-
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
Occasionally hanging sequence of takeUntil()+window()+flatMap() #1677
Comments
Replacing subscrinbeOn() with observeOn() shows the same hang. |
Which version you are using? Is it because #1656? |
On rxjava-0.20.4 Which release is #1656 in? |
Found a concurrent issue in Still investigating a lockless fix. Also found takeUntil is still not fixed. Done it in #1686. |
Fixed in #1686 |
BTW, you should not call |
Is that an RxJava requirement? I do not see any such constraints mentioned in the JavaDocs for the method. |
Right. When you call
PublishSubject will expect that the events should be serialized. |
Based on this, for correctness, I changed the test case to synchronize on 's' around "s.onCompleted()". I can confirm that problem 2 persists after that as well. However, I can't be totally sure if this is a valid test case. I feel that the counter should give the same number as NITERS in the code. Maybe less, but never greater. When it fails, it shows counter to be 1 greater than the expected, NITERS. If you have an insight into this part of the test case, let me know. However, I am not able to reproduce problem 1 (hang), with or without the synchronized block. I can't tell why it is not reproducible anymore. So, effectively this test case doesn't seem to reproduce anymore the original intention of this issue. |
The bug in |
I am unable to replicate this issue on 1.0.0-rc.5 while running the above code in a tight loop for several minutes. Also Sharma, the easy and idiomatic way to serialize access to the Subject is like this: final PublishSubject<Object> s = PublishSubject.create();
final Observer<Object> _s = new SerializedObserver<Object>(s); I think this is common enough I'm going to add a |
This test case brings out two problems, seemingly due to concurrency bugs. They don't happen every time, but do happen if you repeat running it a handful of times.
Problem 1 happens easily if you repeat the test, say, 10 times. Problem 2 is rare. Although, I am not completely sure if my expectation for problem 2 is correct.
The text was updated successfully, but these errors were encountered: