Return-Path: X-Original-To: apmail-karaf-user-archive@minotaur.apache.org Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC8D018B48 for ; Tue, 5 Jan 2016 05:46:46 +0000 (UTC) Received: (qmail 12017 invoked by uid 500); 5 Jan 2016 05:46:46 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 11971 invoked by uid 500); 5 Jan 2016 05:46:46 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 11961 invoked by uid 99); 5 Jan 2016 05:46:45 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2016 05:46:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7D56FC093C for ; Tue, 5 Jan 2016 05:46:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.114 X-Spam-Level: *** X-Spam-Status: No, score=3.114 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Ez_qh4y_XBL7 for ; Tue, 5 Jan 2016 05:46:34 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id A926E42A73 for ; Tue, 5 Jan 2016 05:46:33 +0000 (UTC) Received: from mfilter17-d.gandi.net (mfilter17-d.gandi.net [217.70.178.145]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 15166FB89E for ; Tue, 5 Jan 2016 06:46:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter17-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter17-d.gandi.net (mfilter17-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id MUyi8PmXfTJV for ; Tue, 5 Jan 2016 06:46:30 +0100 (CET) X-Originating-IP: 82.238.224.4 Received: from [192.168.134.10] (bre91-1-82-238-224-4.fbx.proxad.net [82.238.224.4]) (Authenticated sender: jb@nanthrax.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6EBEAFB887 for ; Tue, 5 Jan 2016 06:46:30 +0100 (CET) Subject: Re: Upgrade to MINA SSHD 0.14.0 breaks karaf-client SSH client timeout To: user@karaf.apache.org References: <1451947565996-4044587.post@n3.nabble.com> From: =?UTF-8?Q?Jean-Baptiste_Onofr=c3=a9?= Message-ID: <568B58B5.1010601@nanthrax.net> Date: Tue, 5 Jan 2016 06:46:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1451947565996-4044587.post@n3.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit 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