An entry delivered to a consumer and never acknowledged stays in the pending entries list indefinitely, which is the mechanism that makes recovery possible and the one that leaks if nothing sweeps it.
# everything outstanding, which on a busy stream is a lot
XPENDING orders workers
# only what has been idle for a minute, which is the actionable set
XPENDING orders workers IDLE 60000 - + 10
# and taking it over
XCLAIM orders workers worker-2 60000 1539172800123-0
The IDLE filter is what makes the sweep cheap — without it you fetch everything pending and filter in the client. Sixty seconds is a threshold to choose rather than copy: too short and a slow but healthy consumer has its work taken and done twice, which is only survivable because handlers are idempotent. XAUTOCLAIM collapses the two commands into one and arrives in 6.2, so until then the sweep is a timer in every worker.