Skip to content

Commit 22acec8

Browse files
Small revert to fix hanging
1 parent f314be2 commit 22acec8

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

va/va.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type RemoteVA struct {
9797
type vaMetrics struct {
9898
// validationLatency is a histogram of the latency to perform validations
9999
// from the primary and remote VA perspectives. It's labelled by:
100-
// - operation: VA.ValidateChallenge or VA.CheckCAA as [challenge|caa|challenge+caa]
100+
// - operation: VA.DoDCV or VA.CheckCAA as [challenge|caa|challenge+caa]
101101
// - perspective: ValidationAuthorityImpl.perspective
102102
// - challenge_type: core.Challenge.Type
103103
// - problem_type: probs.ProblemType
@@ -428,7 +428,7 @@ func (va *ValidationAuthorityImpl) validateChallenge(
428428
// observeLatency records entries in the validationLatency histogram of the
429429
// latency to perform validations from the primary and remote VA perspectives.
430430
// The labels are:
431-
// - operation: VA.ValidateChallenge or VA.CheckCAA as [challenge|caa]
431+
// - operation: VA.DoDCV or VA.CheckCAA as [challenge|caa]
432432
// - perspective: [ValidationAuthorityImpl.perspective|all]
433433
// - challenge_type: core.Challenge.Type
434434
// - problem_type: probs.ProblemType
@@ -622,13 +622,9 @@ func (va *ValidationAuthorityImpl) performLocalValidation(
622622
return records, nil
623623
}
624624

625-
// PerformValidation performs a local Domain Control Validation (DCV) and CAA
626-
// check for the provided challenge and dnsName. If called on the primary VA and
627-
// local validation passes, it will also perform DCV and CAA checks using the
628-
// configured remote VAs. It returns a validation result and an error if the
629-
// validation failed. The returned result will always contain a list of
630-
// validation records, even when it also contains a problem. This method is not
631-
// MPIC-compliant.
625+
// PerformValidation validates the challenge for the domain in the request.
626+
// The returned result will always contain a list of validation records, even
627+
// when it also contains a problem.
632628
func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, req *vapb.PerformValidationRequest) (*vapb.ValidationResult, error) {
633629
if core.IsAnyNilOrZero(req, req.DnsName, req.Challenge, req.Authz, req.ExpectedKeyAuthorization) {
634630
return nil, berrors.InternalServerError("Incomplete validation request")

va/vampic.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"slices"
1010
"time"
1111

12+
"github.com/letsencrypt/boulder/canceled"
1213
"github.com/letsencrypt/boulder/core"
1314
berrors "github.com/letsencrypt/boulder/errors"
1415
bgrpc "github.com/letsencrypt/boulder/grpc"
@@ -97,7 +98,7 @@ func (va *ValidationAuthorityImpl) remoteDoDCV(ctx context.Context, req *vapb.DC
9798
err error
9899
}
99100

100-
responses := make(chan *response, remoteVACount)
101+
var responses = make(chan *response, remoteVACount)
101102
for _, i := range rand.Perm(remoteVACount) {
102103
go func(rva RemoteVA) {
103104
res, err := rva.DoDCV(ctx, req)
@@ -115,15 +116,16 @@ func (va *ValidationAuthorityImpl) remoteDoDCV(ctx context.Context, req *vapb.DC
115116
passedRIRs := make(map[string]struct{})
116117

117118
var firstProb *probs.ProblemDetails
118-
for resp := range responses {
119+
for i := 0; i < remoteVACount; i++ {
120+
resp := <-responses
119121
var currProb *probs.ProblemDetails
120122
if resp.err != nil {
121123
// Failed to communicate with the remote VA.
122124
failed = append(failed, resp.addr)
123-
if errors.Is(resp.err, context.Canceled) {
125+
if canceled.Is(resp.err) {
124126
currProb = probs.ServerInternal("Secondary domain validation RPC canceled")
125127
} else {
126-
va.log.Errf("Remote VA %q.ValidateChallenge failed: %s", resp.addr, resp.err)
128+
va.log.Errf("Remote VA %q.DoDCV failed: %s", resp.addr, resp.err)
127129
currProb = probs.ServerInternal("Secondary domain validation RPC failed")
128130
}
129131

@@ -134,7 +136,7 @@ func (va *ValidationAuthorityImpl) remoteDoDCV(ctx context.Context, req *vapb.DC
134136
var err error
135137
currProb, err = bgrpc.PBToProblemDetails(resp.result.Problems)
136138
if err != nil {
137-
va.log.Errf("Remote VA %q.ValidateChallenge returned a malformed problem: %s", resp.addr, err)
139+
va.log.Errf("Remote VA %q.DoDCV returned malformed problem: %s", resp.addr, err)
138140
currProb = probs.ServerInternal("Secondary domain validation RPC returned malformed result")
139141
}
140142

0 commit comments

Comments
 (0)