-
Notifications
You must be signed in to change notification settings - Fork 533
RUBY-2495 rework the check_out method #2671
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
Conversation
# | ||
# @param [ Array<Connection> ] connections A list of connections. | ||
# @param [ Object ] service_id The service id. | ||
def close_connections(connections, service_id) | ||
def close_available_connections(service_id) |
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.
Changed this to explicitly close available connections because it was only being used on available connections, and I don't want it to be used for other connections in the future, since if it is used on pending or checked_out connections, the size_cv has to be signaled as well.
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.
Great job!
@@ -1181,6 +1047,239 @@ def clear_pending_connections | |||
@pending_connections.delete(connection) | |||
end | |||
end | |||
|
|||
# The lock should be acquired when calling this method. |
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.
👍
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.
do you think it would be a good idea to raise if the lock is not owned in some of these methods?
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.
Yes, it is a very good idea!
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.
done
No description provided.