The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6180

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
… init

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 0aaac84a42f6af11d2c0d70ea378f0bf25d254b7 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Mon, 9 Sep 2019 20:44:01 +0100
Subject: [PATCH] lxd/cluster/upgrade: Prevents crash if heartbeat occurs
 before dqlite init

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/cluster/upgrade.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/cluster/upgrade.go b/lxd/cluster/upgrade.go
index b7c1440867..a3ddd4d75a 100644
--- a/lxd/cluster/upgrade.go
+++ b/lxd/cluster/upgrade.go
@@ -65,6 +65,10 @@ func MaybeUpdate(state *state.State) error {
                return nil
        }
 
+       if state.Cluster == nil {
+               return fmt.Errorf("Failed checking cluster update, state not 
initialised yet")
+       }
+
        err = state.Cluster.Transaction(func(tx *db.ClusterTx) error {
                outdated, err := tx.NodeIsOutdated()
                if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to