Skip to content

Commit

Permalink
Follow-up from last commit: use new ARI in return value
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jan 14, 2025
1 parent c69ed90 commit a7ae863
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions maintain.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,14 @@ func (cfg *Config) updateARI(ctx context.Context, cert Certificate, logger *zap.
cfg.certCache.mu.Lock()
updatedCert, ok = cfg.certCache.cache[cert.hash]
if !ok {
// cert is no longer in the cache; this can happen for several reasons (past expiration,
// rejected by on-demand permission module, random eviction due to full cache, etc), but
// it probably means we don't have use of this ARI update now, so while we can return it
// to the caller, we don't persist it anywhere beyond that...
cfg.certCache.mu.Unlock()
updatedCert = cert // return input cert, not an empty one
logger.Debug("obtained ARI update, but certificate no longer in cache; discarding ARI update",
updatedCert = cert // return input cert, not an empty one
updatedCert.ari = newARI // might as well give it the new ARI for the benefit of our caller, but it won't be updated in the cache or in storage
logger.Debug("obtained ARI update, but certificate no longer in cache; ARI update will be returned to caller, but not stored",
zap.Time("selected_time", newARI.SelectedTime),
zap.Timep("next_update", newARI.RetryAfter),
zap.String("explanation_url", newARI.ExplanationURL))
Expand Down

0 comments on commit a7ae863

Please sign in to comment.