zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.9k stars 757 forks source link

ZeroMQ connection stays in SYN_SENT state after listener changes IP #603

Open gitzko opened 1 year ago

gitzko commented 1 year ago

I'm building a Docker Swarm system, in which one service acts as a central logger. That logger is a ZeroMQ listener for other ZMQ log clients. I have managed to get this working with listener listening to tcp://logger_svc:20000, however if the listener service gets moved to another node, or restarts, the IP of the listener changes, and all the connections from all log clients go from ESTABLISHED to SYN_SENT state. And there the communication ends. I would appreciate help with getting the ZeroMQ communication back up after the listener IP address changes.

TCP    192.168.5.158:49217    192.168.5.140:20000    SYN_SENT
TCP    192.168.5.158:49218    192.168.5.140:20000    SYN_SENT
TCP    192.168.5.158:49219    192.168.5.140:20000    SYN_SENT
gitzko commented 1 year ago

The issue in this case was with Windows Server DNS cache service, this helped:

New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name MaxCacheTtl -Value 0 -Type DWord
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name MaxNegativeCacheTtl -Value 0 -Type DWord