[ 
https://issues.apache.org/jira/browse/SSHD-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17151050#comment-17151050
 ] 

Thomas Wolf edited comment on SSHD-1028 at 7/3/20, 4:20 PM:
------------------------------------------------------------

Has the behavior of session closing changed?

When I log server-side session creation (in 
{{Nio2Acceptor.AcceptCompletionHandler.onCompleted()}}) and unmapping (in 
{{Nio2Service.unmapSession()}}) and then run 
{{org.apache.sshd.common.forward.ApacheServerJschClientTest}}, I do see all 
server sessions being closed, but most of them only after the last test. Thus 
if you do more than 64 (sequential) tests, it's possible that the session map 
in {{Nio2Service}} contains 64 or more old sessions. If those are still in the 
map when {{AbstractServerSession#getActiveSessionCountForUser()}} is called 
they'll count against the limit.

If I set 
{{server.getProperties().put(ServerFactoryManager.MAX_CONCURRENT_SESSIONS, 
4);}} in {{ApacheServerJschClientTest.startServer()}}, the last two tests fail 
with that same error message: "com.jcraft.jsch.JSchException: 
SSH_MSG_DISCONNECT: 12 Too many concurrent connections (4) - max. allowed: 4".

It's not related to JSch being used for the client – I can provoke the same 
kind of failure also with the {{ApacheServerApacheClientTest}} if I set 
MAX_CONCURRENT_SESSIONS to 4.


was (Author: wolft):
Has the behavior of session closing changed?

When I log server-side session creation (in 
{{Nio2Acceptor.AcceptCompletionHandler.onCompleted()}}) and unmapping (in 
{{Nio2Service.unmapSession()}}) and the run 
{{org.apache.sshd.common.forward.ApacheServerJschClientTest}}, I do see all 
server sessions being closed, but most of them only after the last test. Thus 
if you do more than 64 (sequential) tests, it's possible that the session map 
in {{Nio2Service}} contains 64 or more old sessions. If those are still in the 
map when {{AbstractServerSession#getActiveSessionCountForUser()}} is called 
they'll count against the limit.

If I set 
{{server.getProperties().put(ServerFactoryManager.MAX_CONCURRENT_SESSIONS, 
4);}} in {{ApacheServerJschClientTest.startServer()}}, the last two tests fail 
with that same error message: "com.jcraft.jsch.JSchException: 
SSH_MSG_DISCONNECT: 12 Too many concurrent connections (4) - max. allowed: 4".

It's not related to JSch being used for the client – I can provoke the same 
kind of failure also with the {{ApacheServerApacheClientTest}} if I set 
MAX_CONCURRENT_SESSIONS to 4.

> SSH_MSG_DISCONNECT: 12 "Too many concurrent connections (64) - max. allowed: 
> 64"
> --------------------------------------------------------------------------------
>
>                 Key: SSHD-1028
>                 URL: https://issues.apache.org/jira/browse/SSHD-1028
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.5.0
>         Environment: bazel test 
> //javatests/com/google/gerrit/acceptance/git:SshPushForReviewIT
>            Reporter: David Ostrovsky
>            Priority: Major
>
> I'm trying to migrate Gerrit to 2.5.0 and seeing this exception:
> {code}
> 80) 
> pushCommitsWithSameTreeNoChanges(com.google.gerrit.acceptance.git.SshPushForReviewIT)
> com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 12 Too many concurrent 
> connections (64) - max. allowed: 64 
>       at com.jcraft.jsch.Session.read(Session.java:1004)
>       at com.jcraft.jsch.UserAuthPublicKey.start(UserAuthPublicKey.java:198)
>       at com.jcraft.jsch.Session.connect(Session.java:470)
>       at com.jcraft.jsch.Session.connect(Session.java:183)
>       at 
> com.google.gerrit.acceptance.SshSession.getSession(SshSession.java:111)
>       at com.google.gerrit.acceptance.SshSession.open(SshSession.java:46)
>       at 
> com.google.gerrit.acceptance.AbstractDaemonTest.initSsh(AbstractDaemonTest.java:541)
>       at 
> com.google.gerrit.acceptance.AbstractDaemonTest.beforeTest(AbstractDaemonTest.java:456)
>       at 
> com.google.gerrit.acceptance.AbstractDaemonTest$1$1.evaluate(AbstractDaemonTest.java:230)
>       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>       at org.junit.runners.Suite.runChild(Suite.java:128)
>       at org.junit.runners.Suite.runChild(Suite.java:27)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>       at org.junit.runners.Suite.runChild(Suite.java:128)
>       at org.junit.runners.Suite.runChild(Suite.java:27)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>       at 
> com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:108)
>       at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
>       at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
>       at 
> com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:116)
>       at 
> com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:159)
>       at 
> com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:85)
> {code}
> Reproducer is here: [1].
> [1] https://gerrit-review.googlesource.com/c/gerrit/+/274055



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to