karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-4246) sshd 0.14.0 breaks client timeout
Date Wed, 06 Jan 2016 08:19:39 GMT

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

ASF subversion and git services commented on KARAF-4246:
--------------------------------------------------------

Commit 48c791585b21122977b041b812ce7be4823953cb in karaf's branch refs/heads/karaf-3.0.x from
[~jbonofre]
[ https://git-wip-us.apache.org/repos/asf?p=karaf.git;h=48c7915 ]

KARAF-4246 - Add support of idle timeout to the client


> 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: 3.0.5, 4.0.3
>            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