zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.53k stars 2.34k forks source link

ZeroMQ favors one IP when DNS name resolves to two IPs #4575

Open gitzko opened 1 year ago

gitzko commented 1 year ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

ZeroMQ seems to favor one IP over the other when DNS name returns two IPs. Like tcp://log_svc:20000 and

nslookup log_svc
Server:         127.0.0.11
Address:        127.0.0.11#53

Non-authoritative answer:
Name:   log_svc
Address: 192.168.6.54
Name:   log_svc
Address: 192.168.6.55

Environment

Minimal test code / Steps to reproduce the issue

  1. send log message using m_socket->send(msg, ZMQ_DONTWAIT);

What's the actual result? (include assertion message & call stack if applicable)

The log messages arrive more often on one IP than the other

What's the expected result?

The log messages are evenly distributed between both IPs