-
Notifications
You must be signed in to change notification settings - Fork 284
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
Refactored the RemoteClient to support connection pooling & drop none answer #206
Conversation
Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.
Also tried to fix #181 |
Add some quick tests (something like dispatcher_test or better) for resolvers? |
Well in fact I tried, but later I found I all used your original resolver code and I'm a little confused about how to test it |
And Thank you for your effort and contributation! |
Hmm... maybe add some tests in dispatcher test to cover all these resolvers? Never mind. That is an bonus, I will consider it again afterwards. |
I've added a simple test for those resolvers :) |
Thanks, sorry for my low code quality :( |
@@ -111,6 +111,8 @@ Configuration file is "config.json" by default: | |||
"OnlyPrimaryDNS": false, | |||
"IPv6UseAlternativeDNS": false, | |||
"AlternativeDNSConcurrent": false, | |||
"PoolIdleTimeout": 15, | |||
"PoolMaxCapacity": 15, |
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.
It would be better if "InitialCap", "MaxCap" and "IdleTimeout" can be grouped by something like "TCPPoolConfig" perhaps?
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.
Yep, I've saw your changes :) 💯
Thank you for your contribution. By the way, I found some EOF errors when connection pool is used so I remove the connection pool from config sample for this time being. If it is can be tested without any problem in a period of time, I will add it back. |
Well those connection pool parameters need to be finetuned carefully. Many DNS & proxy likes to break the connection, and that's why I added the PoolTimeout option |
Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.