Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaky connections #223

Closed
wants to merge 1 commit into from
Closed

Commits on Oct 17, 2024

  1. Fix leaky connections

    Fixes djc#221
    
    It's possible to trigger more approvals than are necessary, in turn
    grabbing more connections than we need. This happens when we drop a
    connection. The drop produces a notify, which doesn't get used until the
    pool is empty. The first `Pool::get()` call on an empty pool will spawn
    an connect task, immediately complete `notify.notified().await`, then
    spawn a second connect task. Both will connect and we'll end up with 1
    more connection than we need.
    
    Rather than address the notify issue directly, this fix introduces some
    bookkeeping that tracks the number of open `pool.get()` requests we have
    waiting on connections. If the number of pending connections >= the
    number of pending gets, we will not spawn any additional connect tasks.
    tneely committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    382d18b View commit details
    Browse the repository at this point in the history