mirror of
https://github.com/docker/compose.git
synced 2026-11-20 15:09:50 +00:00
fix(start): key the wait-timeout message on errWaitTimeout
start() translated any DeadlineExceeded from the plan into a dependency-readiness message when --wait-timeout was set, including one from an engine call or a hook. Use the marker a wait node's own timeout now carries, as upDetached does. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
0caec9ef7a
commit
13b2300bf3
1 changed files with 1 additions and 17 deletions
|
|
@ -92,23 +92,7 @@ func (s *composeService) start(ctx context.Context, projectName string, options
|
|||
exec.waitTimeout = options.WaitTimeout
|
||||
|
||||
if err := exec.run(ctx, plan); err != nil {
|
||||
// Same distinction as upDetached: ctx.Err() == nil rules out ctx's
|
||||
// own external deadline (unrelated to --wait-timeout) having fired
|
||||
// during exec.run, so a DeadlineExceeded here can only be one of the
|
||||
// plan's own OpWaitCondition nodes timing out.
|
||||
if options.WaitTimeout > 0 && ctx.Err() == nil && errors.Is(err, context.DeadlineExceeded) {
|
||||
if options.Wait {
|
||||
return fmt.Errorf("application not healthy after %s", options.WaitTimeout)
|
||||
}
|
||||
// No --wait: this is the dependency-timeout failure
|
||||
// waitDependencies already reports as "timeout waiting for
|
||||
// dependencies" elsewhere -- matching that established,
|
||||
// actionable message instead of leaking the raw
|
||||
// "context deadline exceeded" a user never configured in those
|
||||
// terms.
|
||||
return errors.New("timeout waiting for dependencies")
|
||||
}
|
||||
return err
|
||||
return translateWaitTimeout(err)
|
||||
}
|
||||
|
||||
if !options.Wait {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue