mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-18 14:43:08 +08:00
a1c2216c2c
Issue: - On high load, the keep alive timers keep firing and may get blocked in locks, leading to thread starvation. - The `AsyncAutoResetEvent` for subscriptions is triggered from the reader loop inside a lock and the following execution on the subscription workload blocks the reader thread. - A reconnect is never triggered on a 'BadSessionIdInvalid` Fixes: - Use periodic timer for platforms supporting it - Make the `PublishingStopped` and lastkeepalive non blocking by using interlocked variables. - To decouple the reader loop from the subscription processing, create the TaskCompletionSource with `TaskCreationOptions.RunContinuationsAsynchronously` option. - Trigger a reconnect if the KeepAlive read request returns with a bad service result. - Remove unnecessary locks around events, changed calls to be thread safe