docs(src): add missing XML docs and strip tracking-ID comments
Sweep of 203 source files resolving CommentChecker findings: add <summary>/<param>/<returns>/<inheritdoc> where missing, and remove resolved task/issue tracking markers (Tests-NNN, Worker-NNN, Server-NNN, Task N) from code comments. Comment/doc-only — no logic changes. Server+Tests build clean under TreatWarningsAsErrors.
This commit is contained in:
@@ -13,13 +13,10 @@ public sealed class EventStreamService(
|
||||
IOptions<GatewayOptions> options,
|
||||
GatewayMetrics metrics) : IEventStreamService
|
||||
{
|
||||
/// <summary>
|
||||
/// Streams events from a session to the client asynchronously.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Task 4 rewired this from a per-RPC channel that drained the session directly
|
||||
/// to reading the subscriber's lease channel fed by the session's single
|
||||
/// This reads the subscriber's lease channel fed by the session's single
|
||||
/// <see cref="SessionEventDistributor"/> pump. The pump owns the single drain of
|
||||
/// the worker event stream and the worker→public mapping (mirroring the former
|
||||
/// <c>ProduceEventsAsync</c>); this loop is the per-subscriber boundary that
|
||||
@@ -27,33 +24,28 @@ public sealed class EventStreamService(
|
||||
/// and the backpressure/overflow policy.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Task 6 moved the dashboard mirror OFF this per-RPC loop. The dashboard is now a
|
||||
/// The dashboard mirror runs OFF this per-RPC loop. The dashboard is a
|
||||
/// first-class internal subscriber on the session's
|
||||
/// <see cref="SessionEventDistributor"/> (see <c>GatewaySession.StartDashboardMirror</c>),
|
||||
/// so it receives session events even when no gRPC client is streaming. This loop no
|
||||
/// longer mirrors to the dashboard. One deliberate consequence: the dashboard now sees
|
||||
/// so it receives session events even when no gRPC client is streaming. This loop
|
||||
/// does not mirror to the dashboard. One deliberate consequence: the dashboard sees
|
||||
/// RAW session events, not the per-gRPC-subscriber <c>AfterWorkerSequence</c>-filtered
|
||||
/// view this loop applies — the dashboard is a separate LDAP-authenticated monitoring
|
||||
/// view that should see the session's full event activity (per-session dashboard ACL is
|
||||
/// the separate Task 18).
|
||||
/// view that should see the session's full event activity.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Overflow handling (Task 5): the distributor's per-subscriber channel is bounded
|
||||
/// Overflow handling: the distributor's per-subscriber channel is bounded
|
||||
/// and the pump writes non-blocking. When this subscriber's channel is full the pump
|
||||
/// applies the per-subscriber backpressure policy and completes this subscriber's
|
||||
/// channel with a <see cref="SessionManagerException"/>
|
||||
/// (<see cref="SessionManagerErrorCode.EventQueueOverflow"/>). That terminal fault
|
||||
/// surfaces here when the reader's <c>MoveNextAsync</c> throws, and — like the
|
||||
/// pre-epic per-RPC overflow — it propagates to the gRPC client unchanged. The
|
||||
/// overflow metric, and (in the legacy single-subscriber FailFast case) the session
|
||||
/// fault + fault metric, are recorded by the distributor's overflow handler so the
|
||||
/// session, the pump, and other subscribers are isolated from this subscriber's
|
||||
/// slowness.
|
||||
/// surfaces here when the reader's <c>MoveNextAsync</c> throws, and it propagates to
|
||||
/// the gRPC client unchanged. The overflow metric, and (in the legacy
|
||||
/// single-subscriber FailFast case) the session fault + fault metric, are recorded by
|
||||
/// the distributor's overflow handler so the session, the pump, and other subscribers
|
||||
/// are isolated from this subscriber's slowness.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <param name="request">Stream events request.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Async enumerable of MX events.</returns>
|
||||
public async IAsyncEnumerable<MxEvent> StreamEventsAsync(
|
||||
StreamEventsRequest request,
|
||||
[EnumeratorCancellation] CancellationToken cancellationToken)
|
||||
@@ -72,7 +64,7 @@ public sealed class EventStreamService(
|
||||
// the session's own SessionEventStreaming.AllowMultipleEventSubscribers field — the
|
||||
// same source the distributor uses — so the two cannot diverge.
|
||||
//
|
||||
// Reconnect/resume (Task 12): when AfterWorkerSequence > 0 the client is resuming, so
|
||||
// Reconnect/resume: when AfterWorkerSequence > 0 the client is resuming, so
|
||||
// attach via the replay variant that atomically snapshots the replay ring AND registers
|
||||
// the live subscriber under one lock. That single critical section is the crux of the
|
||||
// no-gap/no-duplicate handoff: every replayed event has sequence <= LiveResumeSequence
|
||||
@@ -81,7 +73,7 @@ public sealed class EventStreamService(
|
||||
// channel is dropped exactly once, while no newer event is skipped. See
|
||||
// SessionEventDistributor.RegisterWithReplay for the full argument.
|
||||
//
|
||||
// AfterWorkerSequence == 0 (fresh stream, not a resume) keeps the pre-Task-12 behavior:
|
||||
// AfterWorkerSequence == 0 (fresh stream, not a resume) keeps the original behavior:
|
||||
// a plain attach, no replay, no sentinel, and the live filter watermark stays 0.
|
||||
ulong afterWorkerSequence = request.AfterWorkerSequence;
|
||||
IEventSubscriberLease subscriber;
|
||||
@@ -157,7 +149,7 @@ public sealed class EventStreamService(
|
||||
{
|
||||
// The distributor pump completes every subscriber channel with the source
|
||||
// fault when the worker event stream terminates abnormally; that surfaces
|
||||
// here. Mirror the pre-Task-4 ProduceEventsAsync behavior: fault the
|
||||
// here. Mirror the original ProduceEventsAsync behavior: fault the
|
||||
// session and record the metric, then propagate the terminal fault to the
|
||||
// gRPC client.
|
||||
session.MarkFaulted(workerException.Message);
|
||||
@@ -175,7 +167,7 @@ public sealed class EventStreamService(
|
||||
|
||||
// Queue-depth gauge tracks events the pump has fanned into this subscriber's
|
||||
// channel but the client has not yet consumed — the same "buffered, not yet
|
||||
// delivered" quantity the pre-Task-4 per-RPC channel reported. The bounded
|
||||
// delivered" quantity the original per-RPC channel reported. The bounded
|
||||
// subscriber channel supports counting, so reconcile the gauge to the current
|
||||
// backlog; falling back to a no-op delta if a channel ever cannot count.
|
||||
int backlog = subscriber.Reader.CanCount ? subscriber.Reader.Count : streamQueueDepth;
|
||||
|
||||
@@ -12,6 +12,7 @@ public interface IEventStreamService
|
||||
/// </summary>
|
||||
/// <param name="request">Request payload.</param>
|
||||
/// <param name="cancellationToken">Token to cancel the asynchronous operation.</param>
|
||||
/// <returns>The events emitted for the requested session.</returns>
|
||||
IAsyncEnumerable<MxEvent> StreamEventsAsync(
|
||||
StreamEventsRequest request,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
@@ -164,15 +164,6 @@ public sealed class MxAccessGatewayService(
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Surfaces the public AcknowledgeAlarm RPC. Acknowledgement is
|
||||
/// session-less: the gateway routes it through the always-on
|
||||
/// <see cref="IGatewayAlarmService"/> monitor session. An
|
||||
/// <c>alarm_full_reference</c> that parses as a canonical GUID forwards
|
||||
/// to <c>AcknowledgeAlarmCommand</c>; a <c>Provider!Group.Tag</c>
|
||||
/// reference forwards to <c>AcknowledgeAlarmByNameCommand</c>; anything
|
||||
/// else returns an <c>InvalidRequest</c> diagnostic in the reply.
|
||||
/// </remarks>
|
||||
public override async Task<AcknowledgeAlarmReply> AcknowledgeAlarm(
|
||||
AcknowledgeAlarmRequest request,
|
||||
ServerCallContext context)
|
||||
@@ -195,14 +186,6 @@ public sealed class MxAccessGatewayService(
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Surfaces the public StreamAlarms RPC — the session-less central
|
||||
/// alarm feed. The stream opens with one <c>active_alarm</c> per
|
||||
/// currently-active alarm, then a single <c>snapshot_complete</c>, then
|
||||
/// a <c>transition</c> for every subsequent change. Served by the
|
||||
/// gateway's always-on <see cref="IGatewayAlarmService"/> monitor; any
|
||||
/// number of clients fan out from the single monitor.
|
||||
/// </remarks>
|
||||
public override async Task StreamAlarms(
|
||||
StreamAlarmsRequest request,
|
||||
IServerStreamWriter<AlarmFeedMessage> responseStream,
|
||||
@@ -226,12 +209,6 @@ public sealed class MxAccessGatewayService(
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Snapshot of the active-alarm cache maintained by the gateway's
|
||||
/// always-on alarm monitor. Streams one <see cref="ActiveAlarmSnapshot"/>
|
||||
/// per currently-active alarm and completes — no transitions are
|
||||
/// emitted. Use <c>StreamAlarms</c> for a live transition feed.
|
||||
/// </remarks>
|
||||
public override async Task QueryActiveAlarms(
|
||||
QueryActiveAlarmsRequest request,
|
||||
IServerStreamWriter<ActiveAlarmSnapshot> responseStream,
|
||||
|
||||
@@ -23,6 +23,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Maps a gRPC MX command request to a worker command.
|
||||
/// </summary>
|
||||
/// <param name="request">Request payload.</param>
|
||||
/// <returns>The mapped <see cref="WorkerCommand"/> ready for worker dispatch.</returns>
|
||||
public WorkerCommand MapCommand(MxCommandRequest request)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(request);
|
||||
@@ -39,6 +40,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Maps a worker command reply to a gRPC MX command reply.
|
||||
/// </summary>
|
||||
/// <param name="reply">Worker command reply.</param>
|
||||
/// <returns>The mapped <see cref="MxCommandReply"/>, or a protocol-violation reply if the worker reply carried no public payload.</returns>
|
||||
public MxCommandReply MapCommandReply(WorkerCommandReply reply)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(reply);
|
||||
@@ -58,6 +60,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Maps a worker event to a gRPC MX event.
|
||||
/// </summary>
|
||||
/// <param name="workerEvent">Worker event to map.</param>
|
||||
/// <returns>The mapped <see cref="MxEvent"/>, or an unspecified-family event if the worker event carried no public payload.</returns>
|
||||
public MxEvent MapEvent(WorkerEvent workerEvent)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(workerEvent);
|
||||
@@ -73,6 +76,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates an OK protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.Ok"/>.</returns>
|
||||
public static ProtocolStatus Ok(string message = "OK")
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -86,6 +90,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates an InvalidRequest protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.InvalidRequest"/>.</returns>
|
||||
public static ProtocolStatus InvalidRequest(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -99,6 +104,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a SessionNotFound protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.SessionNotFound"/>.</returns>
|
||||
public static ProtocolStatus SessionNotFound(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -112,6 +118,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a SessionNotReady protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.SessionNotReady"/>.</returns>
|
||||
public static ProtocolStatus SessionNotReady(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -125,6 +132,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a WorkerUnavailable protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.WorkerUnavailable"/>.</returns>
|
||||
public static ProtocolStatus WorkerUnavailable(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -138,6 +146,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a Timeout protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.Timeout"/>.</returns>
|
||||
public static ProtocolStatus Timeout(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -151,6 +160,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a Canceled protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.Canceled"/>.</returns>
|
||||
public static ProtocolStatus Canceled(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
@@ -164,6 +174,7 @@ public sealed class MxAccessGrpcMapper
|
||||
/// Creates a ProtocolViolation protocol status.
|
||||
/// </summary>
|
||||
/// <param name="message">Status message.</param>
|
||||
/// <returns>A <see cref="ProtocolStatus"/> with code <see cref="ProtocolStatusCode.ProtocolViolation"/>.</returns>
|
||||
public static ProtocolStatus ProtocolViolation(string message)
|
||||
{
|
||||
return new ProtocolStatus
|
||||
|
||||
Reference in New Issue
Block a user