Skip to content

Commit

Permalink
Issue #12705 fix orphan session checks (#12708)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel authored Jan 16, 2025
1 parent 19214f7 commit 74a8bc8
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,20 @@ public Set<String> getExpired(Set<String> candidates)
// OTHER contexts that expired a very long time ago (ie not being actively
// managed by any node). As these sessions are not for our context, we
// can't load them, so they must just be forcibly deleted.
try

if (now > (_lastOrphanSweepTime + TimeUnit.SECONDS.toMillis(10 * _gracePeriodSec)))
{
if (now > (_lastOrphanSweepTime + TimeUnit.SECONDS.toMillis(10 * _gracePeriodSec)))
try
{
if (LOG.isDebugEnabled())
LOG.debug("Cleaning orphans at {}, last sweep at {}", now, _lastOrphanSweepTime);

cleanOrphans(now - TimeUnit.SECONDS.toMillis(10 * _gracePeriodSec));
}
}
finally
{
_lastOrphanSweepTime = now;
finally
{
_lastOrphanSweepTime = now;
}
}

return expired;
Expand Down

0 comments on commit 74a8bc8

Please sign in to comment.