benschw / srv-lb

GNU General Public License v3.0
49 stars 9 forks source link

Host down #1

Open danilobuerger opened 8 years ago

danilobuerger commented 8 years ago

Is there any solution in this library on how to handle if a host selected by the load balancer is down? Or would one build that on top? Or would one need a custom strategy for that?

benschw commented 8 years ago

The way I've used it, is in conjunction with a service discovery system (like consul) that is in charge of keeping the dns entries up to date. There is still the ttl window when this data may be stale, but the library does not attempt to validate entries or perform retries (however, since each request to the library hits the DNS server, you could implement your own retry and just query for an address again).

benschw commented 8 years ago

(let me know if I'm misunderstanding your question)

danilobuerger commented 8 years ago

So sorting out hosts that are down (during the ttl window) is out of scope for this library?

benschw commented 8 years ago

Yeah. I think any kind of test would just shrink the ttl, so a real solution would involve retrys similar to how netflix's ribbon does things. This would be interesting to solve but is currently out of scope.