Closed daipom closed 1 year ago
Ah, I've not been aware it. We need to fix it.
I create a PR #142 for now, but we need to discuss how to fix this more fundamentally.
We discussed about it in private chat.
For Fluentd, we should fix it more radically. For example:
TCPSocket.new("127.0.01", 0)
will choose a free port automatically.
Here is one of idea to fix it: https://github.com/fluent/fluentd/blob/a5bf404134f98f32c5cbcbc2f0989d9f88542853/lib/fluent/supervisor.rb#L69-L71
- socket_manager_path = ServerEngine::SocketManager::Server.generate_path
- ServerEngine::SocketManager::Server.open(socket_manager_path)
- ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = socket_manager_path.to_s
+ server = ServerEngine::SocketManager::Server.open
+ ENV['SERVERENGINE_SOCKETMANAGER_PATH'] = server.path.to_s
(Modify ServerEngine::SocketManager::Server.open
without argument to choose path or port automatically)
Thanks for the summary!
I will continue to work on that.
On Windows, SocketManager selects an available port from the dynamic port range.
But shouldn't we need to exclude
excludedportrange
from this?When I installed Docker for Windows, some ports are excluded as follows. This disables
49152
port, but SocketManager tries to bind49152
and fails.I understand I can use the environmental variable
SERVERENGINE_SOCKETMANAGER_PORT
to avoid the excluded range.If it looks like we should improve this feature, I will make a PR.