Repository navigation
P0 Event History: off-WPF bounded batching, loss accounting and 50k benchmark - #167
Conversation
| { | ||
| private sealed record Work(RelayEventRow? Row, TaskCompletionSource<bool>? Barrier); | ||
| private readonly Channel<Work> _channel; | ||
| private readonly EventHistoryJournal _journal; |
| catch (Exception ex) | ||
| { | ||
| Fail("Event History writer failed: " + ex.Message); | ||
| activeBarrier?.TrySetException(new IOException(FailureReason, ex)); | ||
| } |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35857c116d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var indexed = _eventHistoryJournal?.Count ?? 0; | ||
| var pending = _eventHistoryWriter?.PendingCount ?? 0; |
There was a problem hiding this comment.
Publish history counters without taking the disk-writer lock
During sustained ingestion or slow temporary-disk writes, this footer still blocks the WPF Dispatcher: _eventHistoryJournal.Count and PendingCount both acquire the journal's _gate, while AppendBatch holds that same lock across hashing and file writes for an entire batch. The new periodic timer invokes this path even when the Events tab is inactive, so moving append operations to a worker does not isolate UI responsiveness from storage latency. Publish the committed count atomically, or provide a nonblocking status snapshot, rather than acquiring the I/O lock from WPF. This conflicts with the repository's PERF-01 bounded Dispatcher-work contract.
AGENTS.md reference: AGENTS.md:L31-L31
Useful? React with 👍 / 👎.
| Fail("Event History writer queue exceeded its bounded capacity; " + | ||
| "new rows are not indexed, and capture continues independently."); | ||
| return false; |
There was a problem hiding this comment.
Document the new buffering and terminal-overflow policy
This introduces a 4,096-item asynchronous queue whose first overflow permanently closes history admission for the session, but the commit updates no documentation. Operators and maintainers need the output policy to distinguish pending rows from indexed rows, explain that later events remain unindexed after even a transient overflow, and describe reset/close cancellation of queued temporary history. AGENTS.md explicitly requires updating docs/OUTPUT_AND_PERFORMANCE_POLICY.md when buffering or retention behavior changes; add that update alongside this implementation.
AGENTS.md reference: AGENTS.md:L238-L238
Useful? React with 👍 / 👎.
Goal
Harden the P0 numbered Event History delivered in #165/#166 for sustained IEC-101/104 event bursts without blocking the WPF Dispatcher on JSON serialization, SHA256 or file writes.
Design
Channelwriter (4,096 work items, 64-row batches).RecordEventHistoryonly assigns Event # and performs nonblockingTryEnqueue. Serializing/hashing/append happen on a single background worker.events.bin+ fixed-offsetevents.idxremain authoritative; a batch commits under one journal lock, and page reads verify SHA256 and sequence as before.Flushon WPF.Regression and performance
Release gate
Draft until Windows CI, xUnit, CodeQL and full real-WPF acceptance are validated. Physical SICAM 1,200 bps FAT and true RTU FIFO completeness remain separate.