SockJS is not closing websockets
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, nodejs
- Domain
- backend, networking
Research direction
The issue names no files or tests. Start by reproducing the stale websocket and missing close-event behavior described, comparing it with related issue #127 and the Chrome 27/OS X setup. Done means dead connections are handled and the expected close event is emitted without the reported memory growth.
Written by the indexing model from the issue text.
Description
First, this issue is related to #127
SockJS is keeping websocket open (readyState == 1) even when the real connect not exists anymore for a long time (hours and days). And, sometimes, sockjs detect it and changes to readyState == 3 (closed) but NOT EMIT 'close' event (or it emit, but listeners did notice that).
I reproduced readyState == 3 bug at development side once, but I dont know how and I couldn't find a way to reproduce it again. I use chrome 27 at OSX
I solved both issue using a simple heart beat (I send a "ping" through websocket, not through a http get/post). On server side I just use a setInterval and close sockets that not sent heart beat for some long time.
I don't know if it a issue related with sockjs, nodejs, fayer or even chrome.
The point is, this issue is causing memory leak, and some applications (like my) needs to know when user leaves.
before: server memory grows from 100mb to 890mb into 2 days.
now: server memory grows from 100mb to 182mb into 2 days.
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sockjs/sockjs-node
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sockjs/sockjs-node#316 · 14 comments · 26 reactions ·
-
Is prefix a must? Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
sockjs/sockjs-node#311 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
sockjs/sockjs-node#304 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
sockjs/sockjs-node#301 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
sockjs/sockjs-node#298 ·
All issues in sockjs/sockjs-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
neondatabase/website#5944 ·
-
module: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·