Skip to content

Commit

Permalink
fix: hang on redeployment
Browse files Browse the repository at this point in the history
fixes: #2655
  • Loading branch information
stuartwdouglas committed Sep 13, 2024
1 parent 8e72149 commit cdf4931
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/controller/dal/async_calls.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (d *DAL) AcquireAsyncCall(ctx context.Context) (call *AsyncCall, leaseCtx c
return nil, ctx, fmt.Errorf("failed to decrypt async call request: %w", err)
}

lease, leaseCtx := d.leaseDAL.NewLease(ctx, row.LeaseKey, row.LeaseIdempotencyKey, ttl)
lease, leaseCtx := tx.leaseDAL.NewLease(ctx, row.LeaseKey, row.LeaseIdempotencyKey, ttl)
return &AsyncCall{
ID: row.AsyncCallID,
Verb: row.Verb,
Expand Down
4 changes: 2 additions & 2 deletions backend/controller/dal/dal.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (d *DAL) CreateDeployment(ctx context.Context, language string, moduleSchem
}
defer tx.CommitOrRollback(ctx, &err)

existingDeployment, err := d.checkForExistingDeployments(ctx, tx, moduleSchema, artefacts)
existingDeployment, err := tx.checkForExistingDeployments(ctx, tx, moduleSchema, artefacts)
if err != nil {
return model.DeploymentKey{}, err
} else if !existingDeployment.IsZero() {
Expand Down Expand Up @@ -663,7 +663,7 @@ func (d *DAL) ReplaceDeployment(ctx context.Context, newDeploymentKey model.Depl
if err != nil {
return fmt.Errorf("replace deployment failed to set new deployment replicas from %v to %v: %w", oldDeployment.Key, newDeploymentKey, libdal.TranslatePGError(err))
}
err = d.deploymentWillDeactivate(ctx, oldDeployment.Key)
err = tx.deploymentWillDeactivate(ctx, oldDeployment.Key)
if err != nil {
return fmt.Errorf("replace deployment failed willDeactivate trigger from %v to %v: %w", oldDeployment.Key, newDeploymentKey, libdal.TranslatePGError(err))
}
Expand Down

0 comments on commit cdf4931

Please sign in to comment.