Add support for upgrading without losing existing connections

Bug #402398 reported by tomaw on 2007-03-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CtrlProxy
Medium
Unassigned

Bug Description

Similar functionality to irssis /upgrade command, this would allow you to upgrade to new release whilst keeping existing connections to the ircds and (hopefully, although not as importantly) to the connected clients.

Revision history for this message
confusim (confusim) wrote :

Bit offtopic, but are you sure irssi updates itself immediately or does it wait till restart? From my little experience, I'd guess it's up to the kernel whether it wants to keep up a connection even tho the process has been closed.

Revision history for this message
clever (clever-bugs) wrote :

irssi uses an exec syscall which starts the new version
the open sockets are passed on and not closed
by passing itself special args the new copy will learn of the existing open sockets and keep using them
irssi dumps it to a file and feeds the path to that file on the cmdline
just deinit most stuff
dump basic socket data like fd and network name and probly channels its in
run new version which loads that back up

Revision history for this message
clever (clever-nbnet) wrote :

read(0, "\n", 128) = 1
access("/usr/bin/irssi", X_OK) = 0
getuid32() = 1000
stat64("/usr/bin/irssi", {st_mode=S_IFREG|0755, st_size=773068, ...}) = 0
open("/home/clever/.irssi/session", O_RDONLY|O_CREAT|O_LARGEFILE, 0600) = 3
close(3) = 0
unlink("/home/clever/.irssi/session") = 0
open("/home/clever/.irssi/session", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0600) = 3
write(3, "servers", 7) = 7
....
close(3) = 0
write(1, "\33[?25l\33[48;12H\33[K\33[34h\33[?25h", 28) = 28
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
munmap(0xb7952000, 135168) = 0
rt_sigaction(SIGCONT, {SIG_DFL}, {0x8067320, [], 0}, 8) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "\33[m\33[24m\33[23m\33[m\33[24m\33[23m\33[48;1"..., 41) = 41
execve("/usr/bin/irssi", ["/usr/bin/irssi", "--noconnect", "--session=/home/clever/.irssi/se"..., "--home=/home/clever/.irssi", "--config=/hom
e/clever/.irssi/con"...], [/* 35 vars */]) = 0
this short clip from stracing irssi while it upgrades
the read of \n is when i hit enter after giving it the upgrade command it then checks on the new binary and dumps all state data to a session file and runs the new version using execve passing it a few special args to disable autoconnecting and to load the old state from the file
the fd number for all open sockets/files doesnt change so it can just dump what # each socket it as and basic state and then once the other version init's it can just read the sockets and keep working
ctrlproxy would probly need a list of clients and servers in the state file and basic info such as which server/network/fd each connection is and what network/fd each client is at
current nick/channels and other stuff might be optional since most can be queryed from the ircd

Jelmer Vernooij (jelmer) on 2009-07-24
Changed in ctrlproxy:
status: In Progress → Triaged
Jelmer Vernooij (jelmer) on 2010-09-09
Changed in ctrlproxy:
assignee: Jelmer Vernooij (jelmer) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers