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

client: Clean up RPC client on failed connect #218

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

dave-tucker
Copy link
Collaborator

This issue was caught debugging reconnect failures.
We attempt to reconnect as soon as the server disconnects, which allows
us to open a socket, but there is no reply (listdbs fails) at this
point, when we retry again, the rpcClient is not nil, so we assume we're
already connected and don't return an error.

This commit ensures that the rpcClient is set to nil if we fail to
fully connect and adjusts our tests to perform a container restart
instead of simply disconnecting the client to test the reconnect
behaviour.

Signed-off-by: Dave Tucker [email protected]

@coveralls
Copy link

coveralls commented Aug 20, 2021

Pull Request Test Coverage Report for Build 1150077443

  • 1 of 5 (20.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 75.691%

Changes Missing Coverage Covered Lines Changed/Added Lines %
client/client.go 1 5 20.0%
Totals Coverage Status
Change from base Build 1143789399: 0.2%
Covered Lines: 3313
Relevant Lines: 4377

💛 - Coveralls

This issue was caught debugging reconnect failures.
We attempt to reconnect as soon as the server disconnects, which allows
us to open a socket, but there is no reply (listdbs fails) at this
point, when we retry again, the rpcClient is not nil, so we assume we're
already connected and don't return an error.

This commit ensures that the rpcClient is set to nil if we fail to
fully connect and adjusts our tests to perform a container restart
instead of simply disconnecting the client to test the reconnect
behaviour.

Signed-off-by: Dave Tucker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants