Skip to content

Store pools as member variables instead of a RwLock<HashMap>

Legoktm requested to merge unroll-pools into main

This ends up being cleaner because we don't need to wait on a lock across all pools when trying to open a new connections (eliminating a potential race condition). The main downside is that this is not truly future proof, since any new pool we don't account for will trigger a panic instead of gracefully acomodating it. Also there's a lot of repetition, but that can be macro-ed away in the future.

Anecdotal evidence suggests that going up to s15 will cover us for at least a decade, which is more than long enough. There will be some minimal memory waste from the unused OnceCells, but that feels neglible.

Bug: T325951

Merge request reports