Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server is crashing on client disconnect after the heartbeat packet #217

Closed
belochub opened this issue Jun 10, 2017 · 2 comments
Closed

Server is crashing on client disconnect after the heartbeat packet #217

belochub opened this issue Jun 10, 2017 · 2 comments
Assignees
Milestone

Comments

@belochub
Copy link
Member

belochub commented Jun 10, 2017

This bug occurred with JSTP version 0.5.2.
It is also highly possible that this issue isn't still fixed on master, it needs investigation.
The error log:

TypeError: "listener" argument must be a function;
Connection.once (events.js:307:11);
Connection.setTimeout (/metarhia-jstp/lib/connection.js:258:8);
Connection._heartbeatCallback (/metarhia-jstp/lib/connection.js:208:8);
Connection.startHeartbeat (/metarhia-jstp/lib/connection.js:201:8);
Connection.<anonymous> (/metarhia-jstp/lib/server.js:110:18);
Object.onceWrapper (events.js:293:19); emitNone (events.js:86:13);
Connection.emit (events.js:188:7);
Connection._onTimeout (/metarhia-jstp/lib/connection.js:272:8);
ontimeout (timers.js:386:14);
tryOnTimeout (timers.js:250:5);
Timer.listOnTimeout (timers.js:214:5)

@aqrln, may you check this out please?

@belochub
Copy link
Member Author

@aqrln, ping.
I believe, that it happens due to the enroll/unenroll usage for heartbeat timer creation.
Can you investigate this, please?

aqrln added a commit that referenced this issue Aug 2, 2017
Clear handshake timeout on successful handshake and start sending
heartbeat messages on successful handshake handler instead of handshake
timeout handler.

Fixes: #217
Fixes: #283
@nechaido
Copy link
Member

@aqrln this error resurfaced again on node 8.4.0 on branch add-distributed-benchmark while running benchmark.
Steps to reproduce:

  1. node benchmark/distributed/master.js
  2. node benchmark/distributed/server.js
  3. node benchmark/distributed/workers -c 1000 -i 50 -w 3

events.js:341
    throw new TypeError('"listener" argument must be a function');
    ^

TypeError: "listener" argument must be a function
    at Connection.once (events.js:341:11)
    at Connection.setTimeout (/home/nechaido/Projects/metarhia/jstp/lib/connection.js:308:10)
    at callback (/home/nechaido/Projects/metarhia/jstp/lib/connection.js:228:12)
    at Connection.startHeartbeat (/home/nechaido/Projects/metarhia/jstp/lib/connection.js:236:5)
    at Connection.connection.on (/home/nechaido/Projects/metarhia/jstp/lib/server.js:105:20)
    at emitTwo (events.js:125:13)
    at Connection.emit (events.js:213:7)
    at Connection._onSessionCreated (/home/nechaido/Projects/metarhia/jstp/lib/connection.js:489:10)
    at SimpleAuthPolicy.startSession (/home/nechaido/Projects/metarhia/jstp/lib/simple-auth-policy.js:33:5)
    at Connection._processHandshakeRequest (/home/nechaido/Projects/metarhia/jstp/lib/connection.js:466:17)

@nechaido nechaido reopened this Aug 18, 2017
nechaido added a commit that referenced this issue Nov 24, 2017
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Nov 27, 2017
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Dec 13, 2017
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Jan 19, 2018
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Jan 22, 2018
Clear handshake timeout on successful handshake and start sending
heartbeat messages on successful handshake handler instead of handshake
timeout handler.

Fixes: #217
Fixes: #283
PR-URL: #290
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Dmytro Nechai <nechaido@gmail.com>
belochub pushed a commit that referenced this issue Jan 22, 2018
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Jan 22, 2018
Clear handshake timeout on successful handshake and start sending
heartbeat messages on successful handshake handler instead of handshake
timeout handler.

Fixes: #217
Fixes: #283
PR-URL: #290
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Dmytro Nechai <nechaido@gmail.com>
belochub pushed a commit that referenced this issue Jan 22, 2018
* Send Ping-Pong instead of Heartbeat messages.
* Use setInterval() instead of timers.enroll().
* Rewrite tests.

Fixes: #217
PR-URL: #303
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Mykola Bilochub <nbelochub@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants