docs: correct the idempotency description to match shipped behavior - #184
Open
ivanball wants to merge 1 commit into
Open
docs: correct the idempotency description to match shipped behavior#184ivanball wants to merge 1 commit into
ivanball wants to merge 1 commit into
Conversation
The "Other Framework Pieces" bullet still described the concurrency guard as "per-key SemaphoreSlim double-check locking", which was wrong twice over: the semaphore is striped rather than per-key, and since the IDistributedLock work it is only the fallback for a host that registers no lock. Corrected against source read this run: - AddCaching registers IDistributedLock unconditionally, resolving to the SET-NX-PX plus Lua compare-and-delete RedisDistributedLock when an IConnectionMultiplexer is present and a warn-once InProcessDistributedLock otherwise (Infrastructure/DependencyInjection.cs:181-193). - IdempotencyFilter resolves that lock (:109) with LockTimeToLive 30s (:80) and LockWait 5s (:87); the KeyedSemaphoreStripe path (:73) is documented in its own remarks (:31-34, :67) as the no-IDistributedLock fallback. - A duplicate that cannot take the lock gets 409 Conflict (:152, :203-208), which the bullet never mentioned. - The cache key is not the bare client key: BuildCacheKey (:317-331) joins subject, method, route and client key and hashes with SHA-256. - Cached results are 2xx ObjectResult or body-less 2xx StatusCodeResult, a NoContent() 204 replaying as a bare status code (:281-306, :232). Found while re-verifying the Medium series against source; ADR-017 already records the decision, so only this summary had drifted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtKVCeZgqUfArdBFGrZo7k
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
CLAUDE.md"Other Framework Pieces" bullet described the idempotency concurrency guard as "per-keySemaphoreSlimdouble-check locking". That was wrong twice over: the semaphore is striped, not per-key, and since theIDistributedLockwork it is only the fallback for a host that registers no lock.Found while re-verifying the Medium article series against source. ADR-017 already records the decision correctly, so only this summary had drifted. Documentation only, no code change.
Corrected against source read this run
AddCachingregistersIDistributedLockunconditionally, resolving toRedisDistributedLock(SET-NX-PX + Lua compare-and-delete) when anIConnectionMultiplexeris present, else a warn-onceInProcessDistributedLockSource/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:181-193IdempotencyFilterresolves that lock;LockTimeToLive30s,LockWait5sIdempotencyFilter.cs:109,:80,:87IdempotencyFilter.cs:73, remarks at:31-34and:67IdempotencyFilter.cs:152,:203-208IdempotencyFilter.cs:317-331ObjectResultor body-less 2xxStatusCodeResult, aNoContent()204 replaying as a bare status codeIdempotencyFilter.cs:281-306,:232This is also the change that earned scorecard §10 Cross-Cutting Concerns Implementation 8 to 9 in the 2026-08-01 re-score.
🤖 Generated with Claude Code