karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Created] (KARAF-4246) sshd 0.14.0 breaks client timeout
Date Tue, 05 Jan 2016 06:39:39 GMT
Jean-Baptiste Onofré created KARAF-4246:
-------------------------------------------

             Summary: sshd 0.14.0 breaks client timeout
                 Key: KARAF-4246
                 URL: https://issues.apache.org/jira/browse/KARAF-4246
             Project: Karaf
          Issue Type: Bug
          Components: karaf-shell
    Affects Versions: 4.0.3, 3.0.5
            Reporter: Jean-Baptiste Onofré
            Assignee: Jean-Baptiste Onofré
             Fix For: 3.0.6, 4.0.4


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.

This causes the client to time out after 10 minutes even though the server
idle timeout setting is different.

Here's a patch:

{code}
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) {

{code}



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

Mime
View raw message