Skip to content

Commit fd83797

Browse files
committed
Set ZMQ_LINGER
This will discard any pending messages immediately when the socket is closed. The default is to wait forever for any pending messages which can cause the the daemon to hang on shutdown. See: http://api.zeromq.org/4-2:zmq-setsockopt
1 parent 5d1637a commit fd83797

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

networking_mlnx/eswitchd/eswitch_daemon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def _parse_physical_mapping(self):
6464
def _init_connections(self):
6565
context = zmq.Context()
6666
self.socket_os = context.socket(zmq.REP)
67+
self.socket.setsockopt(zmq.LINGER, 0)
6768
os_transport = constants.SOCKET_OS_TRANSPORT
6869
os_port = constants.SOCKET_OS_PORT
6970
os_addr = constants.SOCKET_OS_ADDR

0 commit comments

Comments
 (0)