From 72406c88a2700a0af8cfc368c9a8a52fd9895283 Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Fri, 28 Oct 2016 11:48:52 -0700 Subject: [PATCH] cluster: handle error in 0 running pods recovery --- pkg/cluster/cluster.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 6d87f1a..fb46014 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -161,8 +161,12 @@ func (c *Cluster) run(stopC <-chan struct{}, wg *sync.WaitGroup) { if len(running) == 0 { err := c.disasterRecovery(nil) if err != nil { - panic("TODO: handle disaster recovery error") + if err == errNoBackupExist { + panic("TODO: mark cluster dead if no backup for disaster recovery.") + } + log.Errorf("cluster (%v) fail to recover. Will retry later: %v", c.name, err) } + continue // Backoff, either on normal recovery or error. } if err := c.reconcile(running); err != nil {