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

Refactored the RemoteClient to support connection pooling & drop none answer #206

Merged
merged 9 commits into from
Feb 19, 2020

Conversation

NyaMisty
Copy link
Contributor

Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.

Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.
@NyaMisty NyaMisty changed the title Refactored the RemoteClient to support connection pooling Refactored the RemoteClient to support connection pooling & drop none answer Feb 17, 2020
@NyaMisty
Copy link
Contributor Author

Also tried to fix #181

core/outbound/clients/resolver/base_resolver.go Outdated Show resolved Hide resolved
core/outbound/dispatcher_test.go Outdated Show resolved Hide resolved
@shawn1m
Copy link
Owner

shawn1m commented Feb 17, 2020

Add some quick tests (something like dispatcher_test or better) for resolvers?

@NyaMisty
Copy link
Contributor Author

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

@shawn1m
Copy link
Owner

shawn1m commented Feb 17, 2020

And Thank you for your effort and contributation!

@shawn1m
Copy link
Owner

shawn1m commented Feb 17, 2020

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

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.

@NyaMisty
Copy link
Contributor Author

I've added a simple test for those resolvers :)

@shawn1m shawn1m merged commit 14a8364 into shawn1m:master Feb 19, 2020
@NyaMisty
Copy link
Contributor Author

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,
Copy link
Owner

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?

Copy link
Contributor Author

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 :) 💯

@shawn1m
Copy link
Owner

shawn1m commented Feb 20, 2020

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.

@NyaMisty
Copy link
Contributor Author

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

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.

3 participants