Merge pull request #1731 from AlinMoldovean/diagnostics/CurrentSubscriptionCount_fix

Fix for ServerDiagnostics.CurrentSubscriptionCount decrement at CloseSession
This commit is contained in:
Suciu Mircea Adrian
2022-03-16 15:50:44 +02:00
committed by GitHub
@@ -260,6 +260,7 @@ namespace Opc.Ua.Server
// close the publish queue for the session.
SessionPublishQueue queue = null;
IList<Subscription> subscriptionsToDelete = null;
uint publishingIntervalCount = 0;
lock (m_lock)
{
@@ -304,6 +305,16 @@ namespace Opc.Ua.Server
// delete subscription.
subscription.Delete(context);
// get the count for the diagnostics.
publishingIntervalCount = GetPublishingIntervalCount();
lock (m_server.DiagnosticsWriteLock)
{
ServerDiagnosticsSummaryDataType diagnostics = m_server.ServerDiagnostics;
diagnostics.CurrentSubscriptionCount--;
diagnostics.PublishingIntervalCount = publishingIntervalCount;
}
}
// mark the subscriptions as abandoned.