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

messageChannels map memory leak with REGISTER over websocket connections #3

Closed
deruelle opened this Issue Jul 18, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@deruelle
Member

deruelle commented Jul 18, 2015

In NioWebSocketMessageChannel.processMessage() there's a call to NioTcpMessageProcessor.assignChannelToDestination() which ultimately adds an entry to ConnectionOrientedMessageProcessor.messageChannels with a key from the Contact header of the REGISTER request.

But this key never seems to be removed because the Channel's .getKey() returns a different key, and as far as I can tell the map is only cleaned up by removing the keys that the channels specify. The contact hostname is just some '.invalid' hostname so a key of, e.g. "wss:s03k4bate5k0.invalid:5060" is inserted into the map, but the channel's .getKey() returns "wss:127.0.0.1:40144".

And I believe an entry with the key "wss:127.0.0.1:40144" is inserted into the map by NioWebSocketMessageProcessor.CreateChannel() which is cleaned up because it matches the Channel's own idea of what its key is.

There should be no need for the stack to keep the mapping of Contact to socket connections as this should be done at the application level using RFC 5626 as described in RFC7118

@deruelle deruelle added the bug label Jul 18, 2015

@deruelle deruelle self-assigned this Jul 18, 2015

deruelle added a commit that referenced this issue Jul 18, 2015

GitHub Issue #3
JSIP-504

Removing code that lead to the mem leak on WebSocket Channel with REGISTER. Contribution from Michael Groshans

@deruelle deruelle closed this Jul 18, 2015

deruelle pushed a commit that referenced this issue Nov 3, 2015

deruelle_jean
GitHub Issue #3
JSIP-504

Removing code that lead to the mem leak on WebSocket Channel with REGISTER. Contribution from Michael Groshans

git-svn-id: https://svn.java.net/svn/jsip~svn/trunk@2380 8e71dc83-d81e-6649-80f2-80b843a9b2be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment