Skip to content

Commit 6e73287

Browse files
authored
observer: ccadb: use less RAM (#8892)
Optimize memory usage a bit. For duplicate revoked certs checking, we're keeping a heavyweight map of `map[string]*x509.CRL`. We don't need to keep the full CRL in the map, however, since we're only interested in the IDP that contained the serial. A quick standalone test of the prober shows heap usage goes from ~1.3GB to ~400MB.
1 parent b82d667 commit 6e73287

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

observer/probers/ccadb/ccadb.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import (
1010
"encoding/pem"
1111
"errors"
1212
"fmt"
13-
"github.com/letsencrypt/boulder/observer/probers"
14-
"github.com/letsencrypt/boulder/strictyaml"
15-
"github.com/prometheus/client_golang/prometheus"
1613
"io"
1714
"maps"
1815
"regexp"
1916
"slices"
2017
"time"
2118

19+
"github.com/letsencrypt/boulder/observer/probers"
20+
"github.com/letsencrypt/boulder/strictyaml"
21+
"github.com/prometheus/client_golang/prometheus"
22+
2223
"github.com/letsencrypt/boulder/crl/checker"
2324
"github.com/letsencrypt/boulder/crl/idp"
2425
)
@@ -154,7 +155,8 @@ func (c *CCADBProber) Probe(ctx context.Context) error {
154155
return err
155156
}
156157

157-
serials := make(map[string]*x509.RevocationList)
158+
// Map of serials to their CRL issuingDistributionPoint.
159+
serials := make(map[string]string)
158160

159161
var errs []error
160162
for skid, urls := range crlURLs {
@@ -188,15 +190,10 @@ func (c *CCADBProber) Probe(ctx context.Context) error {
188190
break
189191
}
190192
serialByteString := string(entry.SerialNumber.Bytes())
191-
if otherCRL, ok := serials[serialByteString]; ok {
192-
otherCRLURL, err := getIDP(otherCRL)
193-
if err != nil {
194-
errs = append(errs, fmt.Errorf("failed to get CRL from other CRL: %s", err))
195-
continue
196-
}
193+
if otherCRLURL, ok := serials[serialByteString]; ok {
197194
errs = append(errs, fmt.Errorf("serial %x seen on multiple CRLs: %s and %s", entry.SerialNumber, otherCRLURL, url))
198195
}
199-
serials[serialByteString] = crl
196+
serials[serialByteString] = url
200197
}
201198
}
202199
}

0 commit comments

Comments
 (0)