Skip to content

Commit

Permalink
fix: Poll instead of err (#197)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege committed May 25, 2022
1 parent 6ed91e5 commit 728e3a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/envd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func run(args []string) (bool, error) {
&cli.StringFlag{
Name: flag.FlagBuildkitdImage,
Usage: "docker image to use for buildkitd",
Value: "docker.io/moby/buildkit:v0.10.1",
Value: "docker.io/moby/buildkit:v0.10.3",
},
&cli.StringFlag{
Name: flag.FlagBuildkitdContainer,
Expand Down
9 changes: 2 additions & 7 deletions pkg/buildkitd/buildkitd.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ func (c *generalClient) maybeStart(ctx context.Context,
}
}
c.logger.Debug("container is running, check if it's ready...")
cli, err := client.New(ctx, c.BuildkitdAddr(), client.WithFailFast())
if err != nil {
return "", errors.Wrap(err, "failed to create the buildkit client")
}
c.Client = cli

if err := c.waitUntilConnected(ctx, runningTimeout); err != nil {
return "", errors.Wrap(err, "failed to connect to buildkitd")
Expand All @@ -134,8 +129,8 @@ func (c generalClient) waitUntilConnected(
case <-time.After(interval):
connected, err := c.connected(ctxTimeout)
if err != nil {
// Has not yet started. Keep waiting.
return errors.Wrap(err, "failed to connect to buildkitd")
logrus.Debug("failed to connect to buildkitd")
continue
}
if !connected {
continue
Expand Down

0 comments on commit 728e3a9

Please sign in to comment.