Skip to content

Conversation

@albertasi
Copy link

This PR stops sorting the resolver’s address list in hackney_happy:getbyname/2 by replacing lists:usort(AddrList) with AddrList. The current sorting removes duplicates and reorders IPs, which unintentionally breaks DNS randomness and can cause uneven connection distribution.

Rationale
DNS randomness is a common, simple load-spreading mechanism. Reordering results undermines it.
Duplicate handling is typically the resolver’s responsibility. If duplicates occur, they are rare and harmless; removing them here is not worth the cost of losing order.

@benoitc
Copy link
Owner

benoitc commented Jan 18, 2026

Closing as already fixed. The current master no longer uses lists:usort(AddrList) - the code now returns AddrList directly, preserving DNS order. Thank you for identifying this issue!

@benoitc benoitc closed this Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants