Remove the key from idleQueue if it is empty after dequeue #1922
Conversation
I think this works. We could alternatively use |
Not really asking for this specific PR, but a few more comments explaining the design of the Manager (don't have to be detailed, even a general design comment at the top) would go a long way given that the code is slightly hairier than average http4s :) |
@rossabaker That's a great point. I can make that change. @SystemFw That would definitely be nice. Fwiw, once cats-effect 1.0 is released I can work on purifying the |
@rossabaker Let me know if that looks okay to you. |
As for future work, I think this needs a refactoring anyway to take advantage of cancellation. Would be a good opportunity to see what the cats-effect concurrency tools might buy us. |
@rossabaker I look forward to seeing how I can improve things with the new cats-effect tools |
@tbrown1979 You can start working on it right now probably, cats-effect 1.0 is not out yet but I don't foresee big changes from now until the release. Feel free to ping me should you need a hand with the new concurrency stuff there. @rossabaker Maybe that's a sufficient knock on the door for a milestone? |
Does this actually work as expected still then? As now we don't actually remove an idle connection do we? Meaning we could end up increasing connections? I'm bad at imperative code now, so I apologize. |
@ChristopherDavenport We still do remove an idle connection here. The edit: And as Ross said this preserves the invariant that a |
Should I make the log I added an |
Yet we have experience it does. So I am inclined towards the level it is at. |
Should fix #1920