Best way to administer code updates to server daemon

Discussion in 'Python' started by Daniel da Silva, Jan 21, 2011.

  1. Hi,

    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.

    Thanks,
    Daniel
    Daniel da Silva, Jan 21, 2011
    #1
    1. Advertising

  2. Daniel da Silva

    MRAB Guest

    On 21/01/2011 22:41, Daniel da Silva wrote:
    > Hi,
    >
    > 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.
    >

    As I see it, the server listens for a new client, starts a handler for
    that client (it might be starting the handler in a new thread), and
    then tidies up when the client disconnects.

    The server code could be split into the core and the handler. The core
    of the server might not be updated very often, so it would stay
    running, and the handler would be in another module. There could be
    more than one version of the handler available.

    When the core wanted to start a handler for a new client it would use
    the latest version of the handler, and when an old version of the
    handler was no longer being used by any client then it could be
    discarded.
    MRAB, Jan 21, 2011
    #2
    1. Advertising

  3. Daniel da Silva

    Paul Rubin Guest

    Daniel da Silva <> 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.
    Paul Rubin, Jan 22, 2011
    #3
  4. Daniel da Silva

    Carl Banks Guest

    On Jan 21, 9:27 pm, Paul Rubin <> wrote:
    > Maybe there are other ideas possible too.


    I don't know of any off-hand but there are probably virtual network
    drivers that sit between your server and the network stack that can
    keep a connection open.

    It seems like it'd be a common enough need that someone's figured out
    an easy way to handle it.


    Carl Banks
    Carl Banks, Jan 22, 2011
    #4
  5. Daniel da Silva

    Paul Rubin Guest

    Carl Banks <> writes:
    > I don't know of any off-hand but there are probably virtual network
    > drivers that sit between your server and the network stack that can
    > keep a connection open.
    >
    > It seems like it'd be a common enough need that someone's figured out
    > an easy way to handle it.


    I don't see big conceptual obstacles to making a network stack itself be
    able to package up the internal state of a TCP or even SSL connection,
    and hand it off to another computer over a LAN, so that you could have
    graceful turnover of live connections. They could even cross-update
    info about the connection for hardware failover. I woder if (e.g.)
    Erlang OTP already does something like that. I worked on a device with
    such a feature a while back, based on very special purpose hardware and
    software and a special (hardware) communication bus for the purpose, but
    with some careful coding it can probably be done with stock hardware and
    ethernet.
    Paul Rubin, Jan 23, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Landgraf

    Administer IIS from ASP.NET

    Stefan Landgraf, Oct 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    Stefan Landgraf
    Oct 28, 2003
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    455
    Jean-Paul Calderone
    Mar 20, 2009
  3. Floris Bruynooghe
    Replies:
    1
    Views:
    449
    Floris Bruynooghe
    Mar 24, 2009
  4. single threaded

    Best way to display and administer semi-structured data.

    single threaded, Jun 11, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    116
    single threaded
    Jun 17, 2005
  5. Daemon Win32::Daemon;

    , Sep 7, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    250
Loading...

Share This Page