Add caching of unreachable addresses to HybridExchange
#92
Labels
enhancement
New features or improvements to existing functionality
8000
HybridExchange
#92
The
HybridExchange
caches reachable peer addresses to avoid queries to Redis on each message send. However, we don't track which addresses that we know don't work so we still retry them, incurring some additional overhead for each message sent.I initially skipped this in the implementation as there are two reasons an address is unreachable: (1) there is no valid network path (i.e., host behind a NAT) or (2) receiver is temporarily offline. We can't really distinguish the two, so possibly the address cache needs some cooldown on re-trying bad addresses.
It would probably make sense then to factor out the address cache into a separate class that tracks valid and invalid addresses, with some lifetime on the validity of each cache entry (both in the valid and invalid cases).
The text was updated successfully, but these errors were encountered: