Timeout for handshaken clients which never connect to fix memory leak#445
Closed
squidfunk wants to merge 1 commit intosocketio:masterfrom
squidfunk:master
Closed
Timeout for handshaken clients which never connect to fix memory leak#445squidfunk wants to merge 1 commit intosocketio:masterfrom squidfunk:master
squidfunk wants to merge 1 commit intosocketio:masterfrom
squidfunk:master
Conversation
Contributor
|
It's a known issue (I also fixed it already: #408). But @guille is still planning some changes to the handshaking logic so the declined it. Anyways, you are also missing in the patch, this causes the the changes to replicated to different processes. |
Author
|
Ah okay, haven't seen your pull request. However, I can confirm that this is a serious issue in a production environment and hope this will be included in the next release. |
Contributor
|
A fix landed in master. |
darrachequesne
pushed a commit
that referenced
this pull request
Jul 4, 2024
Fix for calling open as a function while its a boolean
darrachequesne
added a commit
that referenced
this pull request
Jul 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under some circumstances there seem to be clients which only perform one handshake and are then never seen again. I don't know the exact source of the problem, but it shouldn't affect the server. However, this problem introduces a memory leak in manager.js. The clients are not correctly removed from the "handshaken" member in manager.js, leading to a memory leak and frequent crashes of the server because of constantly increasing load and cpu (most probably because of operations on this member taking longer and longer).
Here is a graph to illustrate the problem:
http://img684.imageshack.us/img684/9707/handshakememleak.png
(The drop at around 18:00 was the result of a crash)
The fix introduces a timeout which fires after the "client store expiration" and checks if the client has connected within the given interval. If he hasn't, the client is deleted from the "handshaken" member. This fixes the problem of the evergrowing "handshaken" member.