RateLimiter::is_ready() reports token availability without consuming
anything, so a bare `if (limiter.is_ready()) log` never throttles:
the balance never goes negative and the guard is always true. The
borrower contention lines and the crawl temp-transid hold report all
used the bare form; a full-corpus run logged 2.87M "memo reacquire
contention" lines through a 10/s limiter that was doing nothing.
Follow is_ready() with borrow() so each emitted line spends a token
and the limiter engages.
Assisted-by: Claude-Code:claude-fable-5
BEESCOUNT(borrower_dead_reacquire);
static RateLimiter s_reacquire_log_limit(10);
if (s_reacquire_log_limit.is_ready()) {
+ s_reacquire_log_limit.borrow();
BEESLOGDEBUG("memo reacquire contention ("
<< memo.size() << " locks)");
}
BEESCOUNT(borrower_dead_reacquire);
static RateLimiter s_race_log_limit(10);
if (s_race_log_limit.is_ready()) {
+ s_race_log_limit.borrow();
BEESLOGDEBUG("memo reacquire race ("
<< memo.size() << " locks)");
}
// operators do not need to act on it.
static RateLimiter s_hold_report_limit(1.0 / 60);
if (s_hold_report_limit.is_ready()) {
+ s_hold_report_limit.borrow();
BEESLOGDEBUG("crawl held below transid "
<< temp_floor << " by temp file(s):"
<< m_ctx->temp_transid_report());