-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add Connection Pool Close configuration #389
Conversation
Closes: #388 Signed-off-by: Gabriele Santomaggio <[email protected]>
@jonnepmyra Can you please test it? ConnectionPoolConfig = new ConnectionPoolConfig()
{
ConnectionCloseConfig = new ConnectionCloseConfig()
{
Policy = ConnectionClosePolicy.CloseWhenEmptyAndIdle,
IdleTime = TimeSpan.FromSeconds(60)
}
} |
Signed-off-by: Gabriele Santomaggio <[email protected]>
Wow, that was fast :) , thank you! I'm afraid that I will not be as fast ;), it may take a little longer than usual to test due to the holiday period, but I'll test as soon as possible! |
* Dispose of pools when closing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gsantomaggio I did a quick initial review, check out the commit I just made. There is a TODO
to be addressed, maybe?
Thanks a lot @lukebakken Here
You raised a good point and an old "problem" of this client: The behaviour is different from Java and Go, see for example, Go Stream Client We should also add this behaviour to this client, but it will introduce a sort of breaking change. Can we think of a 1.9 version? The change has to deal with the auto-reconnect feature and close all the producers and consumers in the right way to avoid triggering the auto-reconnection |
Signed-off-by: Gabriele Santomaggio <[email protected]>
Hi, I've tested this change and it looks great! In my test case, I created short-lived consumers (create-consume-close) with a couple of seconds between each iteration. Test results: ConnectionClosePolicy.CloseWhenEmpty (as before this change): ConnectionClosePolicy.CloseWhenEmptyAndIdle: great work! |
and close all pending connections when the pool is closed Signed-off-by: Gabriele Santomaggio <[email protected]>
@lukebakken To avoid inconsistency, I added a check during the pool connection close only in case the policy is That is not perfect, but it could be enough for the moment. Version 2.0, we can think of adopting the same Golang and Java behaviour:
This is a breaking change that I want to avoid introducing in this version. With the policy @jonnepmyra thoughts? |
Signed-off-by: Gabriele Santomaggio <[email protected]>
Closes: #388