Copy authz for goroutine in RA. (#3508)
There's a minor data race in UpdateAuthorization where the authorization can be changed in the goroutine concurrently with returning it. This fixes it by copying the authorization as an argument to the goroutine. Fixes #3506.
This commit is contained in:
parent
f2d3ad6d52
commit
5d1a3bbf36
4
ra/ra.go
4
ra/ra.go
|
|
@ -1486,7 +1486,7 @@ func (ra *RegistrationAuthorityImpl) UpdateAuthorization(ctx context.Context, ba
|
|||
// Dispatch to the VA for service
|
||||
|
||||
vaCtx := context.Background()
|
||||
go func() {
|
||||
go func(authz core.Authorization) {
|
||||
records, err := ra.VA.PerformValidation(vaCtx, authz.Identifier.Value, authz.Challenges[challengeIndex], authz)
|
||||
var prob *probs.ProblemDetails
|
||||
if p, ok := err.(*probs.ProblemDetails); ok {
|
||||
|
|
@ -1518,7 +1518,7 @@ func (ra *RegistrationAuthorityImpl) UpdateAuthorization(ctx context.Context, ba
|
|||
"Could not record updated validation: err=[%s] regID=[%d] authzID=[%s]",
|
||||
err, authz.RegistrationID, authz.ID))
|
||||
}
|
||||
}()
|
||||
}(authz)
|
||||
ra.stats.Inc("UpdatedPendingAuthorizations", 1)
|
||||
return authz, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue