mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 06:54:30 +01:00
lightningd: don't abort on incorrect versions, but try to re-exec.
You still shouldn't do this (you could get some transient failures), but at least you have a decent chance if you reinstall over a running daemon, instead of getting confusing internal errors if message formats have changed. Changelog-Added: lightningd: we now try to restart if subdaemons are upgraded underneath us. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Fixes: #4346
This commit is contained in:
@@ -412,8 +412,12 @@ static bool handle_version(struct subd *sd, const u8 *msg)
|
||||
return false;
|
||||
|
||||
if (!streq(ver, version())) {
|
||||
fatal("subdaemon %s version '%s' not '%s'",
|
||||
sd->name, ver, version());
|
||||
log_broken(sd->log, "version '%s' not '%s': restarting",
|
||||
ver, version());
|
||||
sd->ld->try_reexec = true;
|
||||
/* Return us to toplevel lightningd.c */
|
||||
io_break(sd->ld);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -473,7 +477,7 @@ static struct io_plan *sd_msg_read(struct io_conn *conn, struct subd *sd)
|
||||
goto next;
|
||||
case WIRE_STATUS_VERSION:
|
||||
if (!handle_version(sd, sd->msg_in))
|
||||
goto malformed;
|
||||
goto close;
|
||||
goto next;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user