apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".

Home Page:https://brpc.apache.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

revive socket should also re-resolve names

BusyJay opened this issue · comments

commented

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

It's a common practice to switch the backend server by changing DNS record. However,
bRPC only resolve the name once when a channel is initialized, and keep trying the same IP
afterwards. So updating DNS record will lead to permanently failure.

Describe the solution you'd like (描述你期望的解决方法)

Instead of saving butil::EndPoint, socket/channel should save the original remote address
instead. And during health check, the original remote address should be used.

This is also the behavior of gRPC: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md

Describe alternatives you've considered (描述你想到的折衷方案)

Without a builtin solution from bRPC, application will need to develop their health check mechanism (again).

Additional context/screenshots (更多上下文/截图)

Use domain name with lb, like channel.Init("http://baidu.com", "rr", &opts). DomainNamingService will periodically query DNS to get the latest IP.