Runtime.Tests: Two_sdk_cadences_renew_before_expiry... residual ~1% hang under load (cohort rebind never completes; barrier hook vs cross-cadence handshake) #968

Closed
opened 2026-12-02 13:52:50 -05:00 by dohertj2 · 1 comment
Owner

Residual flake left after #965's pacing fixes: Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence still fails ~1% of runs (2-5 per 240) under extreme load (16 parallel lanes + 16 busy loops on 14 cores), on BOTH the old and the new pacing (original baseline: 6/240).

Mode: after the metadata renewal both cadences' cohorts rebind (RemoveSubscriptionItems -> AddSubscriptionItems), but one cohort never completes: diagnostics show e.g. slow(add=0,rem=1) / fast(add=1,rem=2), demands=[] items=[] (everything torn down), or a settle/NextPublished wait that never ends (a renewal tick queued but never handled, i.e. the cohort loop is blocked or dead). The test's BeforeSuccessorAdoptionForTests hook is a Barrier.SignalAndWait that blocks a pool thread inside Publish. Suspects: (a) the barrier waits on a cohort whose Publish never reaches successor != null (e.g. TryPrepareSuccessor takes the ReferenceEquals(_proof, captured) / _previousProof shortcut), so the waiter times out and its attempt dies; (b) a real product race in the cross-cadence successor handshake. Not determined which.

Repro: build Runtime.Tests, copy bin/Debug/net10.0 aside, run the two renewal tests in 16 parallel loops next to CPU burners. Not investigated further.

Related: #965.

Residual flake left after #965's pacing fixes: `Two_sdk_cadences_renew_before_expiry_without_reviving_old_notification_evidence` still fails ~1% of runs (2-5 per 240) under extreme load (16 parallel lanes + 16 busy loops on 14 cores), on BOTH the old and the new pacing (original baseline: 6/240). Mode: after the metadata renewal both cadences' cohorts rebind (RemoveSubscriptionItems -> AddSubscriptionItems), but one cohort never completes: diagnostics show e.g. `slow(add=0,rem=1)` / `fast(add=1,rem=2)`, `demands=[] items=[]` (everything torn down), or a settle/NextPublished wait that never ends (a renewal tick queued but never handled, i.e. the cohort loop is blocked or dead). The test's `BeforeSuccessorAdoptionForTests` hook is a `Barrier.SignalAndWait` that blocks a pool thread inside `Publish`. Suspects: (a) the barrier waits on a cohort whose Publish never reaches `successor != null` (e.g. `TryPrepareSuccessor` takes the `ReferenceEquals(_proof, captured)` / `_previousProof` shortcut), so the waiter times out and its attempt dies; (b) a real product race in the cross-cadence successor handshake. Not determined which. Repro: build Runtime.Tests, copy bin/Debug/net10.0 aside, run the two renewal tests in 16 parallel loops next to CPU burners. Not investigated further. Related: #965.
dohertj2 added the type:testpriority:p3 labels 2026-12-02 13:52:50 -05:00
Author
Owner

Real production race, fixed in 464f8d485 (merged 708a4889c). OtOpcUaNodeManager.TryResolve/TryResolveForRenewal read the committed-definition map twice and reported a node missing if a renewal replaced the definition in between. Demand checks then killed the stream attempt (Source unavailable / freshness break), which caused the barrier timeouts. They now re-check the replacement (bounded at 16). Lookup race test: about 19% missing before, 0 after. Stress: 9/1814 before, 0/960 after. Runtime DataConnections 1028/1028, OpcUaServer DataConnections 63/63. Redundant double renewal filed as a p3 follow-up.

Real production race, fixed in 464f8d485 (merged 708a4889c). OtOpcUaNodeManager.TryResolve/TryResolveForRenewal read the committed-definition map twice and reported a node missing if a renewal replaced the definition in between. Demand checks then killed the stream attempt (Source unavailable / freshness break), which caused the barrier timeouts. They now re-check the replacement (bounded at 16). Lookup race test: about 19% missing before, 0 after. Stress: 9/1814 before, 0/960 after. Runtime DataConnections 1028/1028, OpcUaServer DataConnections 63/63. Redundant double renewal filed as a p3 follow-up.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#968