Skip to content

Commit 04e41ed

Browse files
committed
Merge branch 'healthcheck-timeout' into 'master'
fix(engine): increase the number of health check attempts to consider a container as unhealthy See merge request postgres-ai/database-lab!516
2 parents 904a9d1 + a2fd58a commit 04e41ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

engine/internal/retrieval/engine/postgres/tools/health/healthcheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const (
1717
hcInterval = 5 * time.Second
1818
hcTimeout = 2 * time.Second
1919
hcStartPeriod = 3 * time.Second
20-
hcRetries = 5
20+
hcRetries = 15
2121

2222
// DefaultRestoreInterval defines a default health check interval for database restoration.
2323
DefaultRestoreInterval = 5 * time.Second

engine/internal/retrieval/engine/postgres/tools/tools.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ func CheckContainerReadiness(ctx context.Context, dockerClient *client.Client, c
302302
return nil
303303

304304
case types.Unhealthy:
305-
return errors.New("container health check failed")
305+
return fmt.Errorf("container health check failed. The maximum number of attempts has reached: %d",
306+
resp.Config.Healthcheck.Retries)
306307
}
307308

308309
if healthCheckLength := len(resp.State.Health.Log); healthCheckLength > 0 {

0 commit comments

Comments
 (0)