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

Fixes stalled operation queue in a rare race situation #650

Merged
merged 2 commits into from Nov 22, 2019

Conversation

dariuszseweryn
Copy link
Owner

.subscribeOn() operator seems to be not actually subscribing to the upstream if downstream is already disposed. It seems impossible to track whether the upstream was subscribed or not and therefore side-effects for releasing a queue cannot be reliably run. Getting rid of the operator but running the subscription on the Scheduler’s worker directly makes the operation being always run. It’s the operation’s responsibility to release the queue at a proper moment (when the BluetoothGatt is no longer blocked).

Fixes #644

`.subscribeOn()` operator seems to be not actually subscribing to the upstream if downstream is already disposed. It seems impossible to track whether the upstream was subscribed or not and therefore side-effects for releasing a queue cannot be reliably run. Getting rid of the operator but running the subscription on the `Scheduler`’s worker directly makes the operation being always run. It’s the operation’s responsibility to release the queue at a proper moment (when the `BluetoothGatt` is no longer blocked).
@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Nov 22, 2019
@dariuszseweryn dariuszseweryn self-assigned this Nov 22, 2019
@dariuszseweryn dariuszseweryn merged commit b3570b9 into master Nov 22, 2019
@dariuszseweryn dariuszseweryn deleted the fix/race_stalled_queue branch November 22, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operation queue blocking
1 participant