Skip to content

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

Merged
merged 20 commits into from
Nov 28, 2022
Merged

Conversation

neilshweky
Copy link
Contributor

No description provided.

#
# @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)
Copy link
Contributor Author

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.

@neilshweky neilshweky requested a review from comandeo November 22, 2022 21:46
Copy link

@comandeo comandeo left a 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.

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

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?

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@neilshweky neilshweky requested a review from comandeo November 24, 2022 17:14
@neilshweky neilshweky merged commit c369355 into mongodb:master Nov 28, 2022
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.

2 participants