fix(site-runtime,dcl): low-severity cleanups — observed adapter dispose (S9), alarm-filter overwrite warning (S10), bounded-channel comment (C2), invariant-culture condition fallback (C6)

This commit is contained in:
Joseph Doherty
2026-07-09 02:09:06 -04:00
parent 30886c9426
commit c9ac075e39
5 changed files with 84 additions and 8 deletions
@@ -212,11 +212,11 @@ public class SiteEventLogger : ISiteEventLogger, IDisposable
// on disk I/O or on contention for the write lock.
if (!_writeQueue.Writer.TryWrite(pending))
{
// The channel is unbounded, so the only way TryWrite fails is that the
// writer has been completed (logger disposed). The event cannot be
// persisted fault the Task rather than
// reporting false success, so a caller that awaits a critical audit
// event can tell it was dropped.
// The channel is bounded with DropOldest, so TryWrite only returns false
// once the channel is completed (logger disposed) — full-buffer pressure
// evicts the oldest pending event instead of failing the write. The event
// cannot be persisted — fault the Task rather than reporting false success,
// so a caller that awaits a critical audit event can tell it was dropped.
pending.Completion.TrySetException(
new ObjectDisposedException(nameof(SiteEventLogger),
"Event could not be recorded: the event logger has been disposed."));