Files
lmxopcua/tests/Server
Joseph Doherty 23b28e001f fix(grpc-data): #962 a modify's ack commit releasing a replaced item's interest mid-tick no longer resets the stream
The Runtime.Tests flake (Changing_the_filter_acknowledges_a_new_revision_before_its_snapshot) was a real
production race. DataSubscriptionSession.TickAsync captures the snapshot-complete interest-group leases
under the gate, awaits the snapshot/condition pumps, then reads each lease's changes. A Modify that replaces
an item is committed on the DELIVERY side (the ack's commit -> CommitStaged -> ReleaseItem), which disposes
the replaced item's SourceInterestLease. If that lands between the capture and the read, TryReadChanges
returns false exactly like a lost history and the session answered a successful modify with
Reset: "Source change history expired." (ack, then Reset instead of SnapshotBegin).

InterestGroup now carries Released (set under the gate in ReleaseItem before the lease is disposed); the
tick skips a failed read of a group the session itself released - the replacement has its own snapshot.
A failed read of a group the session still owns is still a reset.

Regression test holds a tick at the capture point (BeforeDirtyTickForTests), commits the modify under it
via a gated transport write, then lets the tick read: red 3/3 before, green after. Stress of the original
scenario (5000 iterations x 6 widths): 137/30000 Reset before, 0/30000 after.
2026-12-01 21:30:59 -05:00
..