lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.16k stars 364 forks source link

Re-lookup DNS names in HttpClient after connect failure #937

Open TheBlueMatt opened 3 years ago

TheBlueMatt commented 3 years ago

@devrandom noted at https://github.com/rust-bitcoin/rust-lightning/pull/931#issuecomment-851624586 that we currently cache the dns resolution result in HttpClient and never re-look-up the name after repeated connection failure. We should cache the T: ToSocketAddrs type instead.

devrandom commented 3 years ago

As a specific use case, assume you have a kubernetes cluster, and bitcoind is on one of the nodes. If the nodes goes down and the service is migrated to another node, the client will experience a disconnect, and the service DNS entry will be repointed at the new node.