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 22:53:18 +07:00 committed by GitHub
parent ccc74ae947
commit 28c27efe43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -154,7 +154,9 @@ func (c *Cluster) initDbConnWithName(dbname string) error {
return false, err2 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 { if finalerr != nil {