Cached filter, rewrite and client snapshots check their age with a monotonic counter instead of the wall clock #434

Merged
claude merged 1 commit from feature/224-snapshot-ttl-monotonic-clock into develop 2026-11-13 17:13:40 -05:00
Owner

Closes #224

RefreshingSnapshot<T>.GetAsync read the wall clock (GetUtcNow()) on every query to check its age. It now stores TimeProvider.GetTimestamp() at load time and compares with GetElapsedTime, a monotonic counter read. The time to live, the >= boundary and the refresh trigger are unchanged.

  • Three test clocks that only moved the wall clock got a matching GetTimestamp, because a snapshot no longer ages from GetUtcNow alone. The verifier went through every TimeProvider fake in the test tree: the remaining wall-clock-only fakes do not reach a snapshot.
  • A new test is red on the old code: a snapshot refreshes when only the timestamp advances past the time to live.
  • Whole solution without the Docker tests: green apart from the two SpaFallbackTests that need a built console.

Not done: the issue's acceptance asks for PipelineLatency and PipelineThroughput at --scale Large, --job default. They were not run on the shared CI runner. A small RewriteEngine benchmark shows the change faster with identical allocation, but it ran under a load of 10 to 26, so its size is not reliable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Closes #224 `RefreshingSnapshot<T>.GetAsync` read the wall clock (`GetUtcNow()`) on every query to check its age. It now stores `TimeProvider.GetTimestamp()` at load time and compares with `GetElapsedTime`, a monotonic counter read. The time to live, the `>=` boundary and the refresh trigger are unchanged. - Three test clocks that only moved the wall clock got a matching `GetTimestamp`, because a snapshot no longer ages from `GetUtcNow` alone. The verifier went through every `TimeProvider` fake in the test tree: the remaining wall-clock-only fakes do not reach a snapshot. - A new test is red on the old code: a snapshot refreshes when only the timestamp advances past the time to live. - Whole solution without the Docker tests: green apart from the two `SpaFallbackTests` that need a built console. **Not done:** the issue's acceptance asks for `PipelineLatency` and `PipelineThroughput` at `--scale Large`, `--job default`. They were not run on the shared CI runner. A small `RewriteEngine` benchmark shows the change faster with identical allocation, but it ran under a load of 10 to 26, so its size is not reliable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Cached filter, rewrite and client snapshots check their age with a monotonic counter instead of the wall clock
All checks were successful
Build / Test .NET on Windows (pull_request) Has been skipped
Build / Compute Version (pull_request) Has been skipped
Build / Test Admin Console (pull_request) Successful in -42s
Build / Lint and Script Tests (pull_request) Successful in -1m46s
Build / Windows Test Gate (pull_request) Successful in -2m39s
Build / Test .NET (pull_request) Successful in 4m47s
Build / Stage Draft Release (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (common) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been skipped
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Publish Release (pull_request) Has been skipped
Build / Pipeline (pull_request) Successful in 0s
06f8f7d740
Closes #224

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit d0323bcd32 into develop 2026-11-13 17:13:40 -05:00
claude deleted branch feature/224-snapshot-ttl-monotonic-clock 2026-11-13 17:13:40 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!434
No description provided.