OpcUaClient: residuals of the #763 stale-BadNoSubscription grace window (slow deletes, PublishError noise, wire-test delays) #764

Closed
opened 2026-11-09 12:48:42 -05:00 by dohertj2 · 3 comments
Owner

Residuals from #763 (fixed with a 5 s grace window for anonymous BadNoSubscription):

  • If deleting the old subscription takes >5 s, a late stale id-0 BadNoSubscription can still fall outside the window and trigger a false loss. A Republish/subscription-state probe would close it, at the cost of async network calls in the error handler — only worth doing if it is observed.
  • The SDK sends publish requests while the session has zero subscriptions; the server answers id-0 BadNoSubscription, which inflates the PublishError counter with noise. Consider not counting id-0 BadNoSubscription when nothing is tracked.
  • The #728 wire test still synchronises with fixed 1500/500 ms delays.
Residuals from #763 (fixed with a 5 s grace window for anonymous `BadNoSubscription`): - If deleting the old subscription takes >5 s, a late stale id-0 `BadNoSubscription` can still fall outside the window and trigger a false loss. A `Republish`/subscription-state probe would close it, at the cost of async network calls in the error handler — only worth doing if it is observed. - The SDK sends publish requests while the session has zero subscriptions; the server answers id-0 `BadNoSubscription`, which inflates the PublishError counter with noise. Consider not counting id-0 BadNoSubscription when nothing is tracked. - The #728 wire test still synchronises with fixed 1500/500 ms delays.
dohertj2 added the driver/opcuaclienttype:followuppriority:p3 labels 2026-11-09 12:48:42 -05:00
Author
Owner

Partly fixed on master 90db63cf: an anonymous BadNoSubscription returned while the driver tracks no subscription is no longer counted as publish_error (everything else counted/handled as before). 2 new OpcUaClientIdlePublishErrorTests with positive controls; the idle-session one fails without the fix. Remaining (keep open): the slow-delete (>5 s) probe and the #728 wire test's fixed delays.

Partly fixed on master 90db63cf: an anonymous BadNoSubscription returned while the driver tracks no subscription is no longer counted as publish_error (everything else counted/handled as before). 2 new OpcUaClientIdlePublishErrorTests with positive controls; the idle-session one fails without the fix. Remaining (keep open): the slow-delete (>5 s) probe and the #728 wire test's fixed delays.
Author
Owner

Wire-test delays removed on master (5eaa561b-equivalent, pushed with the #770 commit): A_condition_already_active_before_subscribe_is_reported_by_ConditionRefresh drops Task.Delay(1500)/(500) for a trailing 'barrier' event polled with the rig's 10 s ceiling, and asserts the exact sequence [Acknowledge, Unspecified] (stricter than before). 5/5 consecutive runs pass at AKKA_TEST_TIMEFACTOR=3; OpcUaServer.IntegrationTests 132/132.
Remaining: the >5 s slow-delete Republish probe — by design only worth doing if a late id-0 BadNoSubscription is ever observed. Keeping open for that.

Wire-test delays removed on master (`5eaa561b`-equivalent, pushed with the #770 commit): `A_condition_already_active_before_subscribe_is_reported_by_ConditionRefresh` drops Task.Delay(1500)/(500) for a trailing 'barrier' event polled with the rig's 10 s ceiling, and asserts the exact sequence [Acknowledge, Unspecified] (stricter than before). 5/5 consecutive runs pass at AKKA_TEST_TIMEFACTOR=3; OpcUaServer.IntegrationTests 132/132. Remaining: the >5 s slow-delete Republish probe — by design only worth doing if a late id-0 BadNoSubscription is ever observed. Keeping open for that.
Author
Owner

Slow-delete residual closed on master 70050c9d. The driver already restamps the grace window when the delete COMPLETES (NoteSubscriptionDeleted(force:true) in the finally of both unsubscribe paths), so a delete slower than 5 s cannot expire the window early; no Republish probe is needed. What was missing was proof: both Unsubscribe paths now delete through the existing DeleteSubscriptionAsync seam, and OpcUaClientSlowDeleteTests holds the delete open 30 s (manual clock) for data and alarm subscriptions, then resubscribes and raises the stale id-0 BadNoSubscription: no ConnectionLost, health Healthy. Positive control: after completion the grace still expires (loss declared). Mutation: removing the post-delete restamp fails both slow-delete tests. With the earlier items (idle PublishError noise 90db63cf, wire-test delays) nothing remains. Evidence: Release build 0 warnings; AKKA_TEST_TIMEFACTOR=3: Driver.OpcUaClient.Tests 298/298, IntegrationTests 5/5, OpcUaServer.IntegrationTests 133/133.

Slow-delete residual closed on master 70050c9d. The driver already restamps the grace window when the delete COMPLETES (NoteSubscriptionDeleted(force:true) in the finally of both unsubscribe paths), so a delete slower than 5 s cannot expire the window early; no Republish probe is needed. What was missing was proof: both Unsubscribe paths now delete through the existing DeleteSubscriptionAsync seam, and OpcUaClientSlowDeleteTests holds the delete open 30 s (manual clock) for data and alarm subscriptions, then resubscribes and raises the stale id-0 BadNoSubscription: no ConnectionLost, health Healthy. Positive control: after completion the grace still expires (loss declared). Mutation: removing the post-delete restamp fails both slow-delete tests. With the earlier items (idle PublishError noise 90db63cf, wire-test delays) nothing remains. Evidence: Release build 0 warnings; AKKA_TEST_TIMEFACTOR=3: Driver.OpcUaClient.Tests 298/298, IntegrationTests 5/5, OpcUaServer.IntegrationTests 133/133.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#764