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
GEODE-8613: Removing exclusive access to creation/closing of pool connections #676
Conversation
e391f84
to
fd0a800
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need more time to review this for correctness. I think the locking is required here to both protect concurrent updates to the m_poolSize
value in various places as well as synchronize the CPU caches of this member.
Wouldn't that already be guaranteed given that the type of |
I hadn't looked into the type yet but mostly yes that should be safe. Though if the pool and count are mutated independently there could be some issues with a mismatch. I will poke into this later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we mutate both the poolsize and queue under lock still so I am cool. We might spuriously go into the connection creation methods now but that's ok for this simplification of the locking. This whole chunk of code is begging for a refactor. Perhaps something closer to what we did on the Java side.
This PR removes the exclusive access to the creation/closing of pool connections that uses the mutex that is also used to grant exclusive access to the ConnectionQueue.
That way access to the connection queue is not impaired when there are problems creating connections.