karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: Upgrade to MINA SSHD 0.14.0 breaks karaf-client SSH client timeout
Date Tue, 05 Jan 2016 05:46:29 GMT
Thanks for the update, I will create a Jira about that.

Regards
JB

On 01/04/2016 11:46 PM, kotoole wrote:
> karaf-client.jar in Karaf version 3.0.5 has a new client idle timeout added
> as a result of ugprading to MINA SSHD 0.14.0. Related issue is
> https://issues.apache.org/jira/browse/SSHD-368.
>
> This causes the client to time out after 10 minutes even though the server
> idle timeout setting is different.
>
> Below is a patch that would essentially have it behave as it did in prior
> versions with the client timeout being set to the same as the server
> timeout:
>
> Index: src/main/java/org/apache/karaf/client/ClientConfig.java
> ===================================================================
> --- src/main/java/org/apache/karaf/client/ClientConfig.java	(revision 33766)
> +++ src/main/java/org/apache/karaf/client/ClientConfig.java	(revision 33767)
> @@ -38,6 +38,7 @@
>       private int level;
>       private int retryAttempts;
>       private int retryDelay;
> +    private long idleTimeout;
>       private boolean batch;
>       private String file = null;
>       private String keyFile = null;
> @@ -64,6 +65,7 @@
>           level = Integer.parseInt(shellCfg.getProperty("logLevel", "1"));
>           retryAttempts = 0;
>           retryDelay = 2;
> +        idleTimeout =
> Long.parseLong(shellCfg.getProperty("sshIdleTimeout"));
>           batch = false;
>           file = null;
>           user = null;
> @@ -293,4 +295,8 @@
>       public String getKeyFile() {
>           return keyFile;
>       }
> +
> +    public long getIdleTimeout() {
> +      return idleTimeout;
> +    }
>   }
> Index: src/main/java/org/apache/karaf/client/Main.java
> ===================================================================
> --- src/main/java/org/apache/karaf/client/Main.java	(revision 33766)
> +++ src/main/java/org/apache/karaf/client/Main.java	(revision 33767)
> @@ -37,6 +37,7 @@
>   import org.apache.sshd.client.UserInteraction;
>   import org.apache.sshd.client.channel.ChannelShell;
>   import org.apache.sshd.client.future.ConnectFuture;
> +import org.apache.sshd.common.FactoryManager;
>   import org.apache.sshd.common.RuntimeSshException;
>   import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
>   import org.fusesource.jansi.AnsiConsole;
> @@ -78,6 +79,7 @@
>           int exitStatus = 0;
>           try {
>               client = SshClient.setUpDefaultClient();
> +            client.getProperties().put(FactoryManager.IDLE_TIMEOUT,
> String.valueOf(config.getIdleTimeout()));
>               setupAgent(config.getUser(), config.getKeyFile(), client);
>               final Console console = System.console();
>               if (console != null) {
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Upgrade-to-MINA-SSHD-0-14-0-breaks-karaf-client-SSH-client-timeout-tp4044587.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message