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
@@ -47,7 +47,9 @@ public static class OtOpcUaTelemetry
/// <c>PollGroupEngine.OverrunCount</c>. <c>Core.Abstractions</c> deliberately carries no metrics
/// dependency, so each poll driver wires this counter to the engine's <c>onOverrun</c> callback;
/// this is the production consumer that surface was always missing. Tagged
/// <c>driver.type</c> (a <c>DriverTypeNames</c> constant) + <c>driver.instance</c>.
/// <see cref="PollOverrunDriverTypeTag"/> (<c>driver_type</c>, a <c>DriverTypeNames</c> constant)
/// + <see cref="PollOverrunDriverInstanceTag"/> (<c>driver_instance</c>) — snake_case, per the
/// convention those two consts document.
/// A non-zero and climbing rate means the device cannot sustain its configured poll rate — the
/// loop is already running flat out.
/// </summary>
@@ -1036,6 +1036,9 @@ public sealed class ScriptedAlarmEngine : IDisposable
Task work;
try
{
// The null coalesce is defensive only: no current caller can return a null Task
// (every factory is an async lambda or returns a started Task). It costs nothing and
// keeps a future non-async factory from NREing the continuation wiring below.
work = factory() ?? Task.CompletedTask;
}
catch (Exception ex)
@@ -1057,6 +1060,9 @@ public sealed class ScriptedAlarmEngine : IDisposable
// so Dispose's WhenAll still observes (and logs) a background failure.
work.ContinueWith(t =>
{
// Removing BEFORE completing the placeholder is safe (not a window where Dispose could
// miss still-running work): this continuation only runs once the REAL task has already
// finished, so anything a concurrent Dispose could still be waiting for is done.
lock (_inFlightLock) { _inFlight.Remove(placeholder.Task); }
if (t.IsFaulted)
{