Skip to content
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

SubjectSubscriptionManager fix. #964

Merged

Conversation

akarnokd
Copy link
Member

Fix for #961

If an already unsubscribed Subscriber is added, the subscription function ends up in an infinite loop as the inner unsubscription logic changes the state to another object before the outer state machine continues.

  • The outer state machine loop now exits if unsubscription happened and doesn't attempt to modify the state.
  • The removeObserver method is changed so that if the subscription to be removed is not in the array, it returns this instead of an unnecessary copy. In addition, copyOf calls have been replaced by arraycopy to avoid reflective array creation.

@cloudbees-pull-request-builder

RxJava-pull-requests #904 FAILURE
Looks like there's a problem with this pull request

@benjchristensen
Copy link
Member

Interesting bug. Thanks for the fix!

As for the test failure, looks like testNumberOfThreadsOnScheduledMerge has become non-deterministic as a result of recent changes (not your commit).

benjchristensen added a commit that referenced this pull request Mar 13, 2014
@benjchristensen benjchristensen merged commit 52c388b into ReactiveX:master Mar 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants