fix(grpc-data): a raised F5 diagnostic follows the pending set down after a late native transition

The A1 phase-run failure of A_native_transition_leaves_the_F5_pending_set was a real defect: when the
600 ms F5 window closed before the transition was processed (a loaded run), the diagnostic kept the
count from when it was raised (2) although the node manager held the condition established (1).
New deterministic test closes the window first; red before, green after.
This commit is contained in:
Joseph Doherty
2026-11-24 14:47:36 -05:00
parent 95d90c1933
commit fbf9f7b898
3 changed files with 43 additions and 1 deletions
@@ -195,6 +195,22 @@ public sealed class ConditionStateHub : IConditionStateSink
new KeyValuePair<string, object?>("driver", driverInstanceId));
}
/// <summary>
/// A raised diagnostic follows its driver's pending set down (a native transition established one of its
/// conditions after the window closed). Only an existing diagnostic is updated, and the counter is not charged
/// again: these conditions were counted when the diagnostic was raised.
/// </summary>
/// <param name="driverInstanceId">The driver instance.</param>
/// <param name="conditions">The conditions still unknown.</param>
/// <returns>Whether a raised diagnostic was updated.</returns>
public bool UpdateUnsignalled(string driverInstanceId, int conditions)
{
ArgumentException.ThrowIfNullOrEmpty(driverInstanceId);
while (_unsignalled.TryGetValue(driverInstanceId, out var current))
if (_unsignalled.TryUpdate(driverInstanceId, current with { Conditions = conditions }, current)) return true;
return false;
}
/// <summary>A later signal (or the driver's removal) clears the diagnostic.</summary>
/// <param name="driverInstanceId">The driver instance.</param>
/// <returns>Whether a diagnostic was cleared.</returns>
@@ -237,8 +237,13 @@ public sealed partial class DriverHostActor
private void NoteConditionsEstablished(string driverInstanceId, ConditionSignalTracker t, IEnumerable<string> rawPaths)
{
if (t.Pending.Count == 0) return;
var before = t.Pending.Count;
t.Pending.ExceptWith(rawPaths);
if (t.Pending.Count == 0) ClearPendingWindow(driverInstanceId, t);
// A2 review (A1 phase-run failure): a diagnostic raised before this transition must not keep claiming the
// condition — the node manager holds it established now.
else if (t.DiagnosticRaised && t.Pending.Count != before)
_conditionSignals.Hub?.UpdateUnsignalled(driverInstanceId, t.Pending.Count);
}
/// <summary>A forwarded native transition established <paramref name="rawPath"/> (see <see cref="NoteConditionsEstablished"/>).</summary>