question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increase default session timeout longer than default manager heartbeat interval

See original GitHub issue

Currently SessionManager’s default heartbeat is 25 seconds and timeout is 5 seconds. So if there are no messages for a session within 5 seconds, the connection is closed.

If those are intended defaults, I would like to know why and it should be documented explicitly. If not, session timeout should become longer than heartbeat intervals by default to avoid confusion of new sockjs package users.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iceboy233commented, Dec 18, 2018

The 5 seconds timeout was taken from nodejs disconnect_delay: https://github.com/aio-libs/sockjs/commit/b0d7d17646527f89be172c092f9f69c5ffea8a97#diff-c4ae142f5c8b2a63ea9689afef142593

They are different parameters. nodejs disconnect_delay means interval to close the transport after client initiates the disconnect but the server does not respond (but it’s also used when initiating the connection): https://github.com/sockjs/sockjs-node/blob/4c9f3009be13962b0785138ccdf527c5abe925f6/lib/session.js

nodejs has a different heartbeat_delay for heartbeat, and it’s still different from the timeout: https://github.com/sockjs/sockjs-node/blob/4c9f3009be13962b0785138ccdf527c5abe925f6/lib/transport/websocket.js#L78

This was working fine until the heartbeat behavior silently changed: https://github.com/aio-libs/sockjs/commit/9c29e9921f815c0146882abab1240cd80473f4ab#diff-c4ae142f5c8b2a63ea9689afef142593R306

0reactions
jersobhcommented, Aug 31, 2021

Closing this issue since #265 is merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending the default timeout periods for vCenter Server, ESX ...
Three hours (10800 seconds ) is generally sufficient, but in some environments, you might need to increase the timeout values to a longer...
Read more >
Tuning the SIP Session timeout on the Sametime Bandwidth Manager
In the Integrated Solutions Console for the Bandwidth Manager, click Sametime Servers > Bandwidth Manager. Navigate to the “Configuration” tab. Change the “ ......
Read more >
Customizing the Session Options
For Heartbeat Timeout, specify the amount of time the system should “wait” before terminating a session when the endpoint does not send a...
Read more >
Session timeout does't work vaadin - Stack Overflow
The session timeout should be longer than the heartbeat interval or otherwise sessions are closed before the heartbeat can keep them alive. As ......
Read more >
Tuning Server Performance – Logi Analytics
Be sure performance.exe_gc=false as the default in the server.properties file. ... If the heartbeat interval is longer than the session timeout time, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found