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:
parent
ccc74ae947
commit
28c27efe43
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue