[
https://issues.apache.org/jira/browse/SSHD-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Szmajda updated SSHD-417:
-------------------------------
Attachment: Screen Shot 2015-02-25 at 10.19.04 pm.png
Screen Shot 2015-02-25 at 10.19.14 pm.png
Screen Shot 2015-02-25 at 10.18.51 pm.png
Screen Shot 2015-02-25 at 10.18.36 pm.png
Screen Shot 2015-02-25 at 10.18.13 pm.png
Screen Shot 2015-02-25 at 10.19.49 pm.png
Hi [~gnt], I just ran the same test on SSHD 0.13.0 and the latest master
(656f0d17e5cf2b7384156feb77c193d5c85f0e77) and while there definitely seems to
be some difference, I can still reproduce the problem.
Here's the number of {{ServerSession}}s leaked if I hit our server with 10000
connections that instantly close.
|| IoServiceFactory || SSHD 0.13.0 || SSHD 1.0.0-SNAPSHOT ||
| default | 9923 | 2709 |
| mina | 4736 | 10000 |
| nio2 | 9939 | 3056 |
I repeated this for the default, {{MinaServiceFactoryFactory}}, and
{{Nio2ServiceFactoryFactory}}, as this seems to make some difference.
I attach screenshots of the heap dumps.
> Memory leak in IoServiceListenerSupport.managedSessions when clients cut
> connections quickly
> --------------------------------------------------------------------------------------------
>
> Key: SSHD-417
> URL: https://issues.apache.org/jira/browse/SSHD-417
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 0.13.0
> Reporter: Chris Szmajda
> Attachments: Screen Shot 2015-02-25 at 10.18.13 pm.png, Screen Shot
> 2015-02-25 at 10.18.36 pm.png, Screen Shot 2015-02-25 at 10.18.51 pm.png,
> Screen Shot 2015-02-25 at 10.19.04 pm.png, Screen Shot 2015-02-25 at 10.19.14
> pm.png, Screen Shot 2015-02-25 at 10.19.49 pm.png, testing-stash-7105.zip
>
>
> Raised from https://jira.atlassian.com/browse/STASH-7105
> If you open and close a connection really fast it seems to hold onto lots of
> them in {{IoServiceListenerSupport}}
> In the wild this is sometimes caused by haproxy health checks.
> Can be reproduced running this python script
> {code}
> import socket
> import sys
> TCP_IP = '127.0.0.1'
> TCP_PORT = 7999
> def makeTestConnection():
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect((TCP_IP, TCP_PORT))
> s.close()
> numConnections = 10000
> if len(sys.argv) == 2:
> numConnections = int(sys.argv[1])
> for i in range(numConnections):
> print(str(i))
> makeTestConnection()
> {code}
> If you take a heap dump afterwards you will see lots of session objects.
> There seems to be a 2 minute auth timeout that gets hit and some of the
> sessions are removed but the majority are not removed.
> Creating 10000 connections in seems to result in around 7000 of them hanging
> around.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)