File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -802,12 +802,26 @@ Dash.prototype._initZmqSubSocket = function(node, zmqUrl) {
802802 var self = this ;
803803 node . zmqSubSocket = zmq . socket ( 'sub' ) ;
804804
805+ log . info ( `ZMQ opening socket to '${ zmqUrl } '` ) ;
806+
807+ // workaround for https://github.com/zeromq/zeromq.js/issues/574
808+ var tcpTimeout = 5 * 1000 ;
809+ var timeout = setTimeout ( function ( ) {
810+ // neither accepting nor rejecting - either invalid or firewalled (DROP)
811+ log . error ( `ZMQ address '${ zmqUrl } ' cannot be reached` ) ;
812+ process . exit ( 1 ) ;
813+ } , tcpTimeout ) ;
814+
805815 node . zmqSubSocket . on ( 'connect' , function ( fd , endPoint ) {
806816 log . info ( 'ZMQ connected to:' , endPoint ) ;
817+ clearTimeout ( timeout ) ;
818+ timeout = null ;
807819 } ) ;
808820
809821 node . zmqSubSocket . on ( 'connect_delay' , function ( fd , endPoint ) {
810822 log . warn ( 'ZMQ connection delay:' , endPoint ) ;
823+ clearTimeout ( timeout ) ;
824+ timeout = null ;
811825 } ) ;
812826
813827 node . zmqSubSocket . on ( 'disconnect' , function ( fd , endPoint ) {
You can’t perform that action at this time.
0 commit comments