From 3506f0928564a23c16cbc7cb52d7a29ab3a9d1d5 Mon Sep 17 00:00:00 2001 From: Samantha Frank Date: Fri, 15 Nov 2024 16:33:51 -0500 Subject: [PATCH] RA: Make calls to countCertificateIssued and countFailedValidations synchronous (#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. --- ra/ra.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ra/ra.go b/ra/ra.go index b6ce09a5589..765456e8838 100644 --- a/ra/ra.go +++ b/ra/ra.go @@ -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) @@ -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 {