File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -802,12 +802,25 @@ 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 timeout = setTimeout ( function ( ) {
809+ // neither accepting nor rejecting - either invalid or firewalled (DROP)
810+ log . error ( `ZMQ address '${ zmqUrl } ' cannot be reached` ) ;
811+ process . exit ( 1 ) ;
812+ } , 5 * 1000 ) ;
813+
805814 node . zmqSubSocket . on ( 'connect' , function ( fd , endPoint ) {
806815 log . info ( 'ZMQ connected to:' , endPoint ) ;
816+ clearTimeout ( timeout ) ;
817+ timeout = null ;
807818 } ) ;
808819
809820 node . zmqSubSocket . on ( 'connect_delay' , function ( fd , endPoint ) {
810821 log . warn ( 'ZMQ connection delay:' , endPoint ) ;
822+ clearTimeout ( timeout ) ;
823+ timeout = null ;
811824 } ) ;
812825
813826 node . zmqSubSocket . on ( 'disconnect' , function ( fd , endPoint ) {
You can’t perform that action at this time.
0 commit comments