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

Fix the subscriptionsCompleted boolean in query and command channels #220

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

CodeDrivenMitch
Copy link
Contributor

This is the 4.5.x. counterpart of #219.

In normal situations, the current implementation of QueryChannelImpl.isReady() is sufficient. However, in some very rare cases the channel stays connected, while being unable to register query handlers. Despite the failing registering of the handlers the isReady() check wrongfully believes it's health, since the subscriptionsCompleted is never set to false in case of errors.

This PR fixes this problem by setting it to false in the case of errors during registering, and setting it to false during disconnection. The boolean is then determined again when connecting and succeeding.

Note: During a normal disconnect, the outbound stream would be set to null, so it normally works in the way it should. This is for the abnormal situation where the stream is not null, but it's not connected as well.

Copy link
Contributor

@smcvb smcvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

71.4% 71.4% Coverage
0.0% 0.0% Duplication

@smcvb smcvb merged commit 60445ab into connector-4.5.x Aug 3, 2022
@smcvb smcvb deleted the fix-subscriptions-4.5 branch August 3, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants