Handle retry connect to Postgres when ping return EOF error. (#2339)

* Handle retry connect to Postgres when ping return EOF error.
* Update pkg/cluster/database.go

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>

---------

Co-authored-by: Trung Minh Lai <trung.lai@hitachivantara.com>
Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
Trung Minh Lai
2023-08-25 17:53:18 +02:00
committed by GitHub
co-authored by Felix Kunde Trung Minh Lai
parent ccc74ae947
commit 28c27efe43
+3 -1
View File
@@ -154,7 +154,9 @@ func (c *Cluster) initDbConnWithName(dbname string) error {
return false, err2
}
return false, err
// Retry open connection until succeeded.
c.logger.Warningf("could not connect to Postgres database: %v", err)
return false, nil
})
if finalerr != nil {