Skip to content

Commit

Permalink
fix: more errors wrapped around deploy/reserve runners (#2113)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Toohey <[email protected]>
  • Loading branch information
gak and matt2e authored Jul 18, 2024
1 parent d47e3fd commit a2e7a79
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1453,13 +1453,14 @@ func (s *Service) terminateRandomRunner(ctx context.Context, key model.Deploymen
func (s *Service) deploy(ctx context.Context, reconcile model.Deployment) error {
client, err := s.reserveRunner(ctx, reconcile)
if err != nil {
return err
return fmt.Errorf("failed to reserve runner for %s: %w", reconcile.Key, err)
}

_, err = client.runner.Deploy(ctx, connect.NewRequest(&ftlv1.DeployRequest{DeploymentKey: reconcile.Key.String()}))
if err != nil {
return err
return fmt.Errorf("failed to request deploy %s: %w", reconcile.Key, err)
}

return nil
}

Expand All @@ -1477,8 +1478,13 @@ func (s *Service) reserveRunner(ctx context.Context, reconcile model.Deployment)
err = dal.WithReservation(reservationCtx, claim, func() error {
client = s.clientsForEndpoint(claim.Runner().Endpoint)
_, err = client.runner.Reserve(reservationCtx, connect.NewRequest(&ftlv1.ReserveRequest{DeploymentKey: reconcile.Key.String()}))
return err
if err != nil {
return fmt.Errorf("failed request to reserve a runner for %s at %s: %w", reconcile.Key, claim.Runner().Endpoint, err)
}

return nil
})

return
}

Expand Down

0 comments on commit a2e7a79

Please sign in to comment.