Skip to content

Commit

Permalink
RA: Make calls to countCertificateIssued and countFailedValidations s…
Browse files Browse the repository at this point in the history
…ynchronous (#7824)

Solves CI flakes in TestCertificatesPerDomain and
TestIdentifiersPausedForAccount that are the result of a race on the
Redis database. This has the downside of making failed validations and
successful finalizations take slightly longer.
  • Loading branch information
beautifulentropy authored Nov 15, 2024
1 parent 3baac6f commit 3506f09
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ra/ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ func (ra *RegistrationAuthorityImpl) issueCertificateInner(
return nil, nil, wrapError(err, "parsing final certificate")
}

go ra.countCertificateIssued(ctx, int64(acctID), slices.Clone(parsedCertificate.DNSNames), isRenewal)
ra.countCertificateIssued(ctx, int64(acctID), slices.Clone(parsedCertificate.DNSNames), isRenewal)

// Asynchronously submit the final certificate to any configured logs
go ra.ctpolicy.SubmitFinalCert(cert.Der, parsedCertificate.NotAfter)
Expand Down Expand Up @@ -1998,12 +1998,10 @@ func (ra *RegistrationAuthorityImpl) PerformValidation(
if prob != nil {
challenge.Status = core.StatusInvalid
challenge.Error = prob
go func() {
err := ra.countFailedValidations(vaCtx, authz.RegistrationID, authz.Identifier)
if err != nil {
ra.log.Warningf("incrementing failed validations: %s", err)
}
}()
err := ra.countFailedValidations(vaCtx, authz.RegistrationID, authz.Identifier)
if err != nil {
ra.log.Warningf("incrementing failed validations: %s", err)
}
} else {
challenge.Status = core.StatusValid
if features.Get().AutomaticallyPauseZombieClients {
Expand Down

0 comments on commit 3506f09

Please sign in to comment.