node.js - Meteor - Connection Timeout. No heartbeat received -


i following error:

connection timeout. no heartbeat received.

when accessing meteor app (http://127.0.0.1:3000). application has been moved on new pc same code base - , server runs fine no errors, , can access mongodb. cause above error?

the problem seems occur when collection larger. have running on computer loads collections instantaneously. connection to sock takes on minute , grows in size, before failing:

enter image description here enter image description here

meteor's ddp implements sockjs's heartbeats used long-polling. due ddp heartbeat's timeout default of 15s. if access large amount of data , takes lot of time, in case, 1 minute, ddp time out after being blocked long enough operation prevent connections being closed proxies (which can worse), , try reconnect again. can go on forever , may never process completed.

you can try hypothetically disconnecting , reconnecting in short amount of time before ddp closes connection, , divide database access shorter continuous processes can pick on each iteration , see if problem persists:

// while cursorcount <= data {   meteor.onconnection(dbop);   meteor.settimeout(this.disconnect, 1500); // adjust timeout here   meteor.reconnect();   cursorcount++; }  func dbop(cursorcount) {   // database operation here   // pick operation @ cursorcount last .disconnect() left off } 

however, when disconnected live-updating stop well, explicitly reconnecting might make smaller blocking.

see discussion on issue on google groupand meteor hackpad


Comments