Skip to content

Fix cache options race during renewal checks - #397

Open
potatosips wants to merge 2 commits into
caddyserver:masterfrom
potatosips:fix/cache-options-renewal-race
Open

Fix cache options race during renewal checks#397
potatosips wants to merge 2 commits into
caddyserver:masterfrom
potatosips:fix/cache-options-renewal-race

Conversation

@potatosips

Copy link
Copy Markdown

Fixes a data race between Cache.SetOptions and Config.certNeedsRenewal.

certNeedsRenewal now reads RenewCheckInterval under optionsMu.RLock once and uses that local snapshot throughout the renewal decision.

Adds a concurrency regression test that runs Cache.SetOptions and Certificate.NeedsRenewal in parallel.

Related: caddyserver/caddy#7897

Tests:

  • go test -race ./...

Add concurrent test for certificate renewal checks with cache options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant