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: include last checkout verification before idle termination #292

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

oliveigah
Copy link
Contributor

closes #291

Currently, idle verification stops the pool if the first connection exceeds the idle timeout. I don’t believe this is the correct behavior, as it may lead to bugs like those described in the issue.

The general approach here was to add a last checkout timestamp to the pool state and verify it in the handle_ping callback.

While I’m not keen on adding this to the pool state just for idle verification, I couldn’t think of a better solution.

I’ll look into the possibility of adding a handle_ping callback specifically for the pool in nimble_pool, as the current handle_ping applies only to workers and doesn’t fully align with our use case. I think this would provide the semantics we need in Finch.

@oliveigah oliveigah marked this pull request as draft November 1, 2024 02:21
@oliveigah oliveigah marked this pull request as ready for review November 1, 2024 02:34
@oliveigah
Copy link
Contributor Author

@mathieurousseau, I believe I’ve reproduced your issue in a unit test and have a solution in my fork.

If you could test it out in your code to see if it resolves the problem, that would be awesome!

@sneako
Copy link
Owner

sneako commented Nov 7, 2024

Thanks a lot @oliveigah ! I'll wait to see if @mathieurousseau says this resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NimblePool.checkout :idle_timeout When setting pool_max_idle_time
2 participants