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

ClientPool: expose method to remove client by value #439

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

dimitarvdimitrov
Copy link
Contributor

This PR adds a method to remove a client from the pool only if it already hasn't been removed.

This helps in cases where concurrent users of the client want to remove the same client instance and then immediately after that get a new instance. Clients can remove each other's new instances since the access to the pool is serialized via the mutex. If the clients retry removing a client on failed connections this can lead to live-lock.

This PR adds a method to remove a client from the pool only if it already hasn't been removed.

This helps in cases where concurrent users of the client want to remove the same client instance and then immediately after that get a new instance. Clients can remove each other's new instances since the access to the pool is serialized via the mutex. If the clients retry removing a client on failed connections this can lead to live-lock.
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Thank you.

@dimitarvdimitrov dimitarvdimitrov merged commit 92f5481 into main Nov 23, 2023
3 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/client-pool/remove-client-by-equality branch November 23, 2023 18:08
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.

None yet

2 participants