hackney icon indicating copy to clipboard operation
hackney copied to clipboard

Uneven distribution of connections

Open albertasi opened this issue 3 months ago • 1 comments

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.

albertasi avatar Nov 05 '25 09:11 albertasi

PR with fix: https://github.com/benoitc/hackney/pull/789

albertasi avatar Nov 13 '25 11:11 albertasi