mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goldstein Lyor (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SSHD-432) SSH Server fails when is opened and closed 3 times in a row
Date Mon, 07 Sep 2015 14:04:45 GMT

     [ https://issues.apache.org/jira/browse/SSHD-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Goldstein Lyor resolved SSHD-432.
---------------------------------
       Resolution: Won't Fix
         Assignee: Goldstein Lyor  (was: Guillaume Nodet)
    Fix Version/s: 1.0.0

I don't think it should be fixed. If you want to start/stop the server (or the client) several
times, the best thing would be to create a *new* instance - much healthier for all sort of
reasons....

{code:java}
public static SshServer configure(...) {
    SshServer server = SshServer.setupDefaultServer();
    ...configure...
    return server;
}

while(keepRunning) {
   SshServer server = configure();
   server.start();
   try {
       keepRunning = waitForStop(server);
   } finally {
       server.stop();
   }
}
{code}

> SSH Server fails when is opened and closed 3 times in a row
> -----------------------------------------------------------
>
>                 Key: SSHD-432
>                 URL: https://issues.apache.org/jira/browse/SSHD-432
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.13.0
>            Reporter: Pawel Sm7
>            Assignee: Goldstein Lyor
>             Fix For: 1.0.0
>
>
> When I try to start and then stop SSH Server, starting SSH Server for
> the 3. time fails with the error:
> Address already in use: bind.
> In other words, the sequence of actions fail:
> SSH Server start
> SSH Server stop
> SSH Server start
> SSH Server stop
> SSH Server start
> I checked that 2. stop in not fully performed - the 'if' condition is not true:
> CloseableUtils.java, AbstractCloseable.close(), line 282
> if (state.compareAndSet(State.Opened, State.Graceful)) {
> Forcing the condition above to true causes 2. stop to perform
> completely, and as a consequence,
> consecutive SSH Server start/stops work.
> I know this is just workaround, but not complete solution for the problem.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message