decrementBacklog

internal fun decrementBacklog(delta: Int)(source)

Atomically decrements scrapeRequestBacklogSize by delta, clamping at zero.

During disconnect, both connectionContext.close() (which drains buffered channel items) and individual scrape coroutine finally blocks can race to decrement the counter for overlapping items. This CAS loop prevents the counter from going negative.