-
Notifications
You must be signed in to change notification settings - Fork 533
RUBY-3284 Enable max_connecting client option #2739
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
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.
Just a question, and a copy/paste artifact. Otherwise, looks great!
lib/mongo/server/connection_pool.rb
Outdated
@@ -36,6 +36,10 @@ class ConnectionPool | |||
# @since 2.9.0 | |||
DEFAULT_MIN_SIZE = 0.freeze | |||
|
|||
# The default maximum number of connections that can be connecting at | |||
# any given time. | |||
DEFAULT_MAX_CONNECTING = 2.freeze |
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.
Freezing an immutable constant doesn't really do anything, does it? My understanding is that the primary purpose of freezing constants is to prevent them from being modified in place. Is there another reason for freezing numbers (which are already immutable)?
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.
Good point, thank you. Fixed.
spec/mongo/uri/srv_protocol_spec.rb
Outdated
let(:max_connecting) { 10 } | ||
let(:options) { "maxConnecting=#{max_connecting}" } | ||
|
||
it 'sets the max pool size option' do |
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.
Should this read 'sets the max connecting option'
?
lib/mongo/client.rb
Outdated
# This option should be increased if there are many threads that share | ||
# the same client and the application is experiencing timeouts | ||
# while waiting for connections to be established. | ||
# selecting a server for an operation. The default is 100. |
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.
"... The default is 100"
Is that a copy/paste artifact?
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.
It is indeed, good catch! Thank you, fixed.
# Exception that is raised when trying to create a client with an invalid | ||
# max_connecting option. | ||
# | ||
# @since 2.4.2 |
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.
Should this be 2.19.0 (not 2.4.2)?
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.
This is a copy/paste artifact, too. We do not use @SInCE tag at all now. Removed, thank you.
No description provided.