-
Notifications
You must be signed in to change notification settings - Fork 86
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
SocketManager: Enable open(nil)
to select path automatically
#143
Conversation
Use ServerEngine's new feature: treasure-data/serverengine#143 On Windows, this prevents SocketManager from wrongly selecting an unavailable port, such as a port in excluded port range. Signed-off-by: Daijiro Fukuda <[email protected]>
Though quite late now, I'm starting to think this may be better... serverengine/lib/serverengine/socket_manager.rb Lines 91 to 93 in 6c23c4a
def self.open(path = nil)
return new(path) unless path.nil?
if ServerEngine.windows?
new(0)
else
new(self.generate_path)
end
end |
What do you think? If so, I will fix. |
This `open(nil)` selects `path` automatically. Especially on Windows, it is hard to search a available port for `path`, so we should use this feature. (The current `generate_path` logic sometimes chooses unavailable port. For example, it does not consider the excluded port range.) Note: This fix keeps backward compatibility. Signed-off-by: Daijiro Fukuda <[email protected]>
6c23c4a
to
1155c73
Compare
open(nil)
to select path automatically
Use ServerEngine's new feature: treasure-data/serverengine#143 On Windows, this prevents SocketManager from wrongly selecting an unavailable port, such as a port in excluded port range. Signed-off-by: Daijiro Fukuda <[email protected]>
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.
LGTM
Thanks! |
Thanks for your review! |
Use ServerEngine's new feature: treasure-data/serverengine#143 On Windows, this prevents SocketManager from wrongly selecting an unavailable port, such as a port in excluded port range. Signed-off-by: Daijiro Fukuda <[email protected]>
I already created
but we need a more fundamental solution as discussed in #140.
This PR enables
ServerEngine::SocketManager::Server.open(nil)
to selectpath
automatically.Especially on Windows, it is hard to search an available port for
path
, so we should use this feature.(The current
generate_path
logic sometimes chooses an unavailable port. For example, it does not consider the excluded port range.)This fix keeps backward compatibility.