-
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
Fixed deadlock in Subjects + OperatorCache. #972
Fixed deadlock in Subjects + OperatorCache. #972
Conversation
RxJava-pull-requests #912 SUCCESS |
I don't understand these changes yet, but on first review they are very awkward as the |
True, the rewritten Subjects don't require an Action1, they are fine with Action0. The changes had to be made since the CountDonwLatch logic acted as a synchronization block and emitting events while holding locks is prone to deadlocks, as the associated issue demonstrates. |
Ah, holding the lock is the issue. We should find a way of doing that without the latches at all, as it is blocking. |
The latch has its use because once the state has been swapped to terminal state, we still need to perform some tasks on any related state within the particular subject before client notifications can resume: usually, it is to set the last event which then will be available to newcomers. |
I haven't merged this yet as I need to spend time better understanding this and the impact on design. |
Since the collection is being returned we don't want to also inject it as an argument, so I migrated to Action0 from Action1 as per discussion at ReactiveX#972 (comment)
Since this has conflicts and I did some cleanup based on our discussion above, I've opened #1040 for merging this. |
Merge and Cleanup of #972
Fix for Issue #971.