feat(client): implement MultiResolver with Healthcheck and recovery#64
feat(client): implement MultiResolver with Healthcheck and recovery#64hiddify-com wants to merge 3 commits intonet2share:mainfrom
Conversation
|
Thanks for your contribution. Much appreciated. I was thinking of this PR for days, BUT one major issue with the current approach is the use of round-robin. This means that if a single resolver goes down, it can break all connections. A better design would be to maintain multiple sessions, each tied to a specific resolver, and then distribute streams across those sessions. With that setup, if one resolver fails, only some streams are affected and they can recover with retries, instead of the entire session collapsing. In the current implementation, a resolver failure effectively kills the whole session. In the alternative approach, failures are more isolated and recoverable. Also, even the current design could be implemented by using a custom made DNS. For example, you could run something like AdGuard DNSProxy and handle load balancing there, with additional features such as least-latency routing and other optimizations. That would provide a more advanced and flexible version of what is currently implemented, so I would say we have to implement multiple session holding over multiple dns instead of this approach. |
|
I do not fully agree with your point. First, we had already implemented multiple sessions over multiple DNS resolvers in the past, but we encountered real operational issues that led us to introduce the multi-resolver approach for a single DNSTT session instead.
Instead, we can extend the current implementation by collecting statistics per DNS resolver per tunnel. For example, if we track incoming and outgoing packet counts per resolver, we can automatically detect blocked resolvers and stop sending traffic through them for a period.
|
|
We have implemented MultiResolver with health checks and automatic recovery. To monitor the status of resolvers, run the application with: -log-level trace This will show the resolver state and switching behavior. If only a single resolver is configured, the system will behave the same as the previous implementation, and the old behavior will be preserved. |
you can now use multiple time -udp -dot or -doh flags
it needs more tests