docs(code): close-out comment fixes from the follow-ups review round

This commit is contained in:
Joseph Doherty
2026-08-17 04:32:53 -04:00
parent 57c66416d8
commit 7c5a843ace
5 changed files with 28 additions and 4 deletions
@@ -57,9 +57,11 @@ public sealed class SessionAclDecisionCache
/// <see cref="ConcurrentDictionary{TKey,TValue}.Count"/>, which takes every lock in the table — a
/// price the store path would pay on every miss to answer a question that only matters at the
/// ceiling. The counter lags — an insert is in its shard's dictionary a moment before it is booked
/// — but it does not drift: every entry is booked exactly once and unbooked exactly once, when the
/// shard holding it is sealed. See <see cref="SealedShard"/> for how that survives an eviction
/// racing an insert.
/// — but it does not drift: every <b>booked</b> entry is unbooked exactly once, when the shard
/// holding it is sealed. (Not every entry is booked: one whose <see cref="TryBookInsert"/> loses
/// the compare-exchange to a seal is never booked at all, because it is already unreachable in a
/// displaced shard.) See <see cref="SealedShard"/> for how that survives an eviction racing an
/// insert.
/// </remarks>
public const int MaxEntries = 100_000;
@@ -209,6 +211,12 @@ public sealed class SessionAclDecisionCache
{
// The outer bound: no single session is over its own ceiling, so there is nothing narrower to
// drop. Re-acquire the shard — ClearAll drops the shard objects themselves.
//
// Deliberately NOT elected: concurrent callers crossing the ceiling together all run ClearAll,
// and that is safe rather than merely tolerated. ClearAll displaces each shard with a per-shard
// TryRemove, so exactly one thread wins each shard and seals it exactly once; the losers just
// re-enumerate an emptying dictionary. The redundancy costs an enumeration, not correctness,
// and a CAS-elected clear would add hot-path state for a branch that is a rare fallback.
ClearAll();
shard = _shards.GetOrAdd(sessionKey, static _ => new Shard());
}
@@ -2119,6 +2119,9 @@ public sealed class DriverHostActor : ReceiveActor, IWithTimers, IWithUnboundedS
//
// Guarded on IsRelational: the timeout is a relational-only concept and the extension throws
// on a non-relational provider (the in-memory provider the actor tests run against).
// ⚠️ Consequently the relational branch itself is UNTESTED in-suite — every actor test runs
// InMemory, so the suite only ever exercises the guard's false side. The 30 s bound is pinned
// by the EF 10.0.7 verification recorded above, not by a test.
if (db.Database.IsRelational())
db.Database.SetCommandTimeout(TimeSpan.FromSeconds(30));