Fix: spawn task when opening new connection in acquire.#3516
Fix: spawn task when opening new connection in acquire.#3516joeydewaal wants to merge 5 commits intolaunchbadge:mainfrom
Conversation
abonander
left a comment
There was a problem hiding this comment.
This is a good start, but strictly speaking it doesn't fix #2848 because it doesn't retry the idle queue once it decides to connect. That's the problem there.
Once it passes its permit to the spawned task, it could try to acquire another and race to see which completes first. Since the connection is happening in a background task, the attempt won't be wasted, as it'll just return to the idle queue.
|
Now the pool tries to get an idle connection while opening a new connection. It has a backoff mechanism (taken from |
|
Thank you for your effort, but after some thought I realized that |
Does your PR solve an issue?
Fixes #3513,#3315,#3132,#2848
Ive read through the issues and I think this is the solution like proposed in #2848. However I don't think this is done yet. Should the connect_timeout be a part of the public api? Is 30 seconds a good default?