Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
platform/machine/aws: limit console log timeout to 5 minutes
Browse files Browse the repository at this point in the history
util.Retry() doesn't account for the time consumed by one attempt.
util.WaitUntilReady() does.

Behavior change: Retry() makes the first attempt immediately, while
WaitUntilReady() waits until the end of the first interval.
  • Loading branch information
bgilbert committed Feb 12, 2018
1 parent 3591daa commit 5ceb160
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions platform/machine/aws/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,22 @@ func (am *machine) saveConsole(origConsole string) error {
// returned output will be non-empty but won't necessarily include
// the most recent log messages. So we loop until the post-termination
// logs are different from the pre-termination logs.
err := util.Retry(60, 5*time.Second, func() error {
err := util.WaitUntilReady(5*time.Minute, 5*time.Second, func() (bool, error) {
var err error
am.console, err = am.cluster.api.GetConsoleOutput(am.ID())
if err != nil {
return err
return false, err
}

if am.console == origConsole {
plog.Debugf("waiting for console for %v", am.ID())
return fmt.Errorf("timed out waiting for console output of %v", am.ID())
return false, nil
}

return nil
return true, nil
})
if err != nil {
return err
return fmt.Errorf("retrieving console output of %v: %v", am.ID(), err)
}

// merge the two logs
Expand Down

0 comments on commit 5ceb160

Please sign in to comment.