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

Fixed stalled client queue when adapter is off #522

Merged
merged 1 commit into from Dec 28, 2018

Conversation

dariuszseweryn
Copy link
Owner

There was a race condition in ConnectorImpl which was simultaneously scheduling connecting operation and observing BT adapter being switched off. As the client operation queue runs on it’s own thread it was possible that the connecting operation would get scheduled and started but cancelled before the actual protectedRun() would get executed — this result in a situation where the client queue would get blocked and never released due to the operation never being run but still responsible for releasing.
Workaround: start observing BT adapter state after the connecting operation finishes. The operation is observing it either way during the execution and will emit an error if BT is off

Fixes #516

There was a race condition in ConnectorImpl which was simultaneously scheduling connecting operation and observing BT adapter being switched off. As the client operation queue runs on it’s own thread it was possible that the connecting operation would get scheduled and started but cancelled before the actual `protectedRun()` would get executed — this result in a situation where the client queue would get blocked and never released due to the operation never being run but still responsible for releasing.
Workaround: start observing BT adapter state after the connecting operation finishes. The operation is observing it either way during the execution and will emit an error if BT is off
@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Dec 28, 2018
@dariuszseweryn dariuszseweryn self-assigned this Dec 28, 2018
@dariuszseweryn dariuszseweryn merged commit beafcc9 into master Dec 28, 2018
@dariuszseweryn dariuszseweryn deleted the fix/issue_516_queue_stalled_no_bt branch December 28, 2018 17:20
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.

None yet

1 participant