-
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
socket_manager: add feature to share sockets with another server #150
socket_manager: add feature to share sockets with another server #150
Conversation
6546cf2
to
03bc031
Compare
It would be necessary to consider exclusive locks. |
772d7df
to
13b3d39
Compare
Somehow, the fork process couldn't receive SIGTERM, so I gave up using |
13b3d39
to
00eba2a
Compare
It may be better to note explicitly the scope of this PR (out of scope live-restart for supervisor, we focus on server <=> worker) |
95ccac0
to
a514542
Compare
Thanks for your review! |
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.
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.
👍🏻
I'll rebase this. |
Another process can take over UDP/TCP sockets without downtime. server = ServerEngine::SocketManager::Server.share_sockets_with_another_server(path) This starts a new server that shares all UDP/TCP sockets with the existing server. The old process should stop without removing the file for the socket after the new process starts. This allows us to replace both the server and the workers with new processes without socket downtime. (The existing live restart feature does not support network servers. We can restart workers without downtime, but there is no way to restart the network server without downtime.) ref: fluent/fluentd#4622 Limitation: This feature would not work well if the process opens new TCP ports frequently. Signed-off-by: Daijiro Fukuda <[email protected]> Co-authored-by: Shizuo Fujita <[email protected]>
1a839c7
to
9a42d6b
Compare
Thanks for your review! |
Another process can take over UDP/TCP sockets without downtime.
This starts a new server that shares all UDP/TCP sockets with the existing server.
The old process should stop without removing the file for the socket after the new process starts.
This allows us to replace both the server and the workers with new processes without socket downtime.
(The existing live restart feature does not support network servers.
We can restart workers without socket downtime, but there is no such way for the network server.)
ref: fluent/fluentd#4622
Limitation
address already in use
error.TODO