From ecc38c1832efbc2990a741e31c91dc45ea4dbf0d Mon Sep 17 00:00:00 2001 From: Samantha Date: Fri, 15 Nov 2024 09:49:14 -0500 Subject: [PATCH] Fix nil pointer --- va/va.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/va/va.go b/va/va.go index 20dd0ea6677..e9f36c33a86 100644 --- a/va/va.go +++ b/va/va.go @@ -499,7 +499,8 @@ func (va *ValidationAuthorityImpl) performRemoteValidation( var currProb *probs.ProblemDetails if resp.err != nil { - failed = append(failed, resp.result.Perspective) + // Failed to communicate with the remote VA. + failed = append(failed, resp.addr) if canceled.Is(resp.err) { currProb = probs.ServerInternal("Remote PerformValidation RPC canceled") @@ -508,6 +509,7 @@ func (va *ValidationAuthorityImpl) performRemoteValidation( currProb = probs.ServerInternal("Remote PerformValidation RPC failed") } } else if resp.result.Problems != nil { + // The remote VA returned a problem. failed = append(failed, resp.result.Perspective) var err error @@ -517,18 +519,21 @@ func (va *ValidationAuthorityImpl) performRemoteValidation( currProb = probs.ServerInternal("Remote PerformValidation RPC returned malformed result") } } else { + // The remote VA returned a successful result. passed = append(passed, resp.result.Perspective) } if firstProb == nil && currProb != nil { + // A problem was encountered for the first time. firstProb = currProb } - // Return as soon as we have enough successes or failures for a definitive result. if len(passed) >= required { + // Enough successful responses to reach quorum. return nil } if len(failed) > va.maxRemoteFailures { + // Too many failed responses to reach quorum. va.metrics.remoteValidationFailures.Inc() firstProb.Detail = fmt.Sprintf("During secondary validation: %s", firstProb.Detail) return firstProb