hackney
hackney copied to clipboard
Uneven distribution of connections
Hello,
The getbyname/2 function changes the resolver’s address list by calling lists:usort/1. This removes duplicates and reorders the addresses, which breaks dns randomness. In Kubernetes, Service A record returns all pod IPs with randomized order for basic load spreading. Sorting the list removes this randomness, so clients repeatedly connect to the same pod IP instead of distributing requests across all of them.
PR with fix: https://github.com/benoitc/hackney/pull/789