retryOnDbPoolFailure

fun <T> Flow<T>.retryOnDbPoolFailure(label: String): Flow<T>(source)

Restarts a database-backed Flow after the Room pool wedge behind #6608 — an acquire timeout or a stall — with capped exponential backoff. The backoff resets after a successful emission; every other failure propagates.

DatabaseManager.observeCurrentDb recovers a wedged pool in place, but its per-collector and per-window budgets can exhaust while a leaked-permit storm is still active; a stateIn(..., SharingStarted.Eagerly, ...) upstream that then throws is dead for the process lifetime. Retrying re-enters recovery with a fresh collector once the manager's rate window reopens.

Deliberately narrower than DatabaseManager.isDbClosedException: a closed pool is not retried here. observeCurrentDb re-latches on the replacement pool by itself, so retrying adds nothing — and it would keep a flow alive that used to terminate, turning a dead collector into a backoff loop that outlives its collecting scope.