Class HolderLossSweeper

java.lang.Object
at.aimon.session.web.internal.HolderLossSweeper

public final class HolderLossSweeper extends Object
Periodic sweeper that detects holder loss via the IdempotencyStore and emits the recovery sequence required by design §6.3 D / §9.2 stale cleanup.

For every IN_FLIGHT entry whose lastTouchedAt is older than now - secondaryTtl, the sweeper attempts compareAndReset. The CAS winner — exactly one across all nodes — performs:

  1. Emit InterruptedAt(InterruptReason.HOLDER_LOST) to the local InProcessEventPublisher so on-node events() subscribers see a clean termination.
  2. Complete the local publisher for that conversation.
  3. Broadcast ConversationSignal.SignalKind.EVICT so other nodes terminate their publishers identically.

The loop never throws — exceptions are swallowed and logged so a transient backend failure does not kill the scheduled task.