Skip to content

fix: preserve cache settings when reconfiguration is invalid - #78

Merged
dgilland merged 1 commit into
dgilland:masterfrom
Aschenbath:fix/config-atomicity-20261125-42bb
Nov 25, 2026
Merged

dgilland merged 1 commit into
dgilland:masterfrom
Aschenbath:fix/config-atomicity-20261125-42bb

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Cache.configure(maxsize=1, ttl=-1) raises for the invalid TTL after changing maxsize. Catching that error and continuing to use the cache can then evict existing entries unexpectedly. An invalid timer or statistics flag likewise leaves earlier options partially applied.

Validate every supplied option before assigning settings, and document that rejected configuration leaves the existing configuration unchanged. Four regression cases preserve the settings, entries, expiry deadlines, and enabled statistics, then verify that the next insertion still uses the original capacity. All four fail before the fix.

Validation on Windows / Python 3.12.12: all 421 tests and doctests pass with 100% coverage; Ruff lint and format checks, mypy, package sdist/wheel build, and git diff --check pass. Other supported Python versions are left to the CI matrix.

Prepared with OpenAI Codex assistance.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — Aschenbath:fix/config-atomicity-20261125-42bb into dgilland:master

@dgilland
dgilland merged commit c46da4d into dgilland:master Nov 25, 2026
12 checks passed
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.

3 participants