Support seamless upgrades of EM servers #165

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
@pc
Contributor

pc commented Feb 6, 2011

The two commits below allow you to have a server running, and then, fork(), exec(), start a new server using the same socket, finish up requests in the master, and then start processing new requests in the child. This allows you to do upgrades without dropping any requests.

@tmm1

This comment has been minimized.

Show comment
Hide comment
@tmm1

tmm1 Feb 7, 2011

Contributor

See also #93 for an EM.attach_server implementation to use in the new child.

Contributor

tmm1 commented Feb 7, 2011

See also #93 for an EM.attach_server implementation to use in the new child.

@tmm1

This comment has been minimized.

Show comment
Hide comment
@tmm1

tmm1 Mar 24, 2011

Contributor

Sorry it took me so long to look at this. I think the right solution for this use case is to use the attach_server patch along with a patch that exposes a generic cloexec toggle to ruby. See #118 for a hacky way to do this with IO.for_fd and detach currently.

Ideally we would simply have a EM::Connection#close_on_exec=, but that doesn't help in the start_server case where no EM::Connection object is created. This close_on_exec= will probably call something like EM.set_close_on_exec(binding, value) that can also be used with the return value of EM.start_server

Contributor

tmm1 commented Mar 24, 2011

Sorry it took me so long to look at this. I think the right solution for this use case is to use the attach_server patch along with a patch that exposes a generic cloexec toggle to ruby. See #118 for a hacky way to do this with IO.for_fd and detach currently.

Ideally we would simply have a EM::Connection#close_on_exec=, but that doesn't help in the start_server case where no EM::Connection object is created. This close_on_exec= will probably call something like EM.set_close_on_exec(binding, value) that can also be used with the return value of EM.start_server

@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Feb 2, 2015

Contributor

Can this be closed since #465 landed a while ago?

Contributor

sodabrew commented Feb 2, 2015

Can this be closed since #465 landed a while ago?

@sodabrew sodabrew closed this Apr 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment