fix(sessions): exception-total shutdown body with non-cancellable kill fallback

This commit is contained in:
Joseph Doherty
2026-08-15 13:19:08 -04:00
parent 0bc13b5292
commit 95f8ba918d
4 changed files with 86 additions and 24 deletions
@@ -68,6 +68,12 @@ public interface ISessionManager
/// <param name="now">The current time to evaluate expiration against.</param>
/// <param name="cancellationToken">Token to cancel the asynchronous operation.</param>
/// <returns>The number of sessions closed.</returns>
/// <remarks>
/// A close that fails does not abandon the rest of the pass: every session selected by this
/// sweep is attempted, and the first failure is then rethrown so the caller still observes
/// (and logs) that the sweep failed. Which failure surfaces is nondeterministic when several
/// closes fail in the same pass, because the closes run concurrently.
/// </remarks>
Task<int> CloseExpiredLeasesAsync(
DateTimeOffset now,
CancellationToken cancellationToken);