Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

SubjectSubscriptionManager fix.#964

Merged
benjchristensen merged 1 commit intoReactiveX:masterfrom
akarnokd:SubjectSubscriptionManagerFix
Mar 13, 2014
Merged

SubjectSubscriptionManager fix.#964
benjchristensen merged 1 commit intoReactiveX:masterfrom
akarnokd:SubjectSubscriptionManagerFix

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