Best way to administer code updates to server daemon

Paul Rubin no.email at nospam.invalid
Sat Jan 22 00:27:01 EST 2011


Daniel da Silva <ddasilva at umd.edu> writes:
> I am writing a custom IRC server, and I was wondering would be the
> best way to administer code updates to the daemon. Am I doomed to have
> to restart the server every time I want to do an update (which would
> disconnect all clients)? I don't mind doing something a little more
> advanced if it means I can keep close to continuous uptime.

There are several possible approaches:

1) load new code into the server with the import function, being careful
about what data structures you can mess with etc.

2) have a simple front end proxy that maintains the inbound tcp
connections to clients, and uses a connectionless or restartable
protocol to pass the info to the server.  Of course now you have the
issue of how to update the proxy.  But for a serious HA system you have
to do stuff like this anyway.

3) Start the new server in a new process, and use the Linux SCM_RIGHTS
message that lets you pass open file descriptors through Unix domain
sockets, to hand off any open TCP connections from the old server to the
new one.

Maybe there are other ideas possible too.



More information about the Python-list mailing list