mxgateway.sessions.open gauge never decremented for sessions closed by the timed sweep #168
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TryBeginCloseIfExpiredsets_closeStarted, soCloseSessionCoreAsyncskipsSessionClosed()and the open-sessions gauge drifts upward even after reaping. Found during the OtOpcUa 2026-10-21 review cross-check (lmxopcua#735). Fix: decrement on every close path, including sweep closes.Fixed on origin/main and verified (closing as part of #169).
09666cc("account SessionClosed for sweep-driven closes", merged in7f0720f).SessionManager.CloseSessionCoreAsyncnow calls_metrics.SessionClosed()whenever!wasClosed && !result.AlreadyClosed && session.OpenRecorded. That includes the sweep path, whereTryBeginCloseIfExpiredhas already set_closeStarted, and theSessionCloseStartedExceptionpath.SessionManagerTests.CloseExpiredLeasesAsync_SweptClose_AccountsSessionClosedExactlyOnce(theory over the sweep kinds) is green on macOS, and the full gateway suite is 1349/1349 on windev at777fef9.