This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git


The following commit(s) were added to refs/heads/master by this push:
     new 14bbd54  [SSHD-1020] SSH connections getting closed abruptly with 
timeout exceptions
14bbd54 is described below

commit 14bbd54a5a3030b15916dd7af95fb98cf3a4ad94
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Wed Jul 22 17:43:00 2020 +0200

    [SSHD-1020] SSH connections getting closed abruptly with timeout exceptions
---
 CHANGES.md                                                         | 1 +
 .../org/apache/sshd/client/session/ClientConnectionService.java    | 2 +-
 .../src/main/java/org/apache/sshd/core/CoreModuleProperties.java   | 4 ++--
 sshd-netty/pom.xml                                                 | 7 ++++---
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 4e8967d..8678205 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -22,6 +22,7 @@
 
 ## Behavioral changes and enhancements
 
+* [SSHD-1020](https://issues.apache.org/jira/browse/SSHD-1020) SSH connections 
getting closed abruptly with timeout exceptions.
 * [SSHD-1028](https://issues.apache.org/jira/browse/SSHD-1028) Fix 
SSH_MSG_DISCONNECT: Too many concurrent connections.
 * [SSHD-1033](https://issues.apache.org/jira/browse/SSHD-1033) Fix 
simultaneous usage of dynamic and local port forwarding.
 * [SSHD-1039](https://issues.apache.org/jira/browse/SSHD-1039) Fix support for 
some basic options in ssh/sshd cli.
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
 
b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
index a32f80a..ab27200 100644
--- 
a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
+++ 
b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientConnectionService.java
@@ -125,7 +125,7 @@ public class ClientConnectionService
             buf.putBoolean(withReply);
 
             if (withReply) {
-                Buffer reply = session.request(heartbeatRequest, buf, 
heartbeatReplyMaxWait.toMillis(), TimeUnit.MILLISECONDS);
+                Buffer reply = session.request(heartbeatRequest, buf, 
heartbeatReplyMaxWait);
                 if (reply != null) {
                     if (log.isTraceEnabled()) {
                         log.trace("sendHeartBeat({}) received reply size={} 
for request={}",
diff --git 
a/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java 
b/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
index 9e9b2d2..f51f1a1 100644
--- a/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
+++ b/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
@@ -144,7 +144,7 @@ public final class CoreModuleProperties {
      * for the reply. If non-positive then no reply is expected (nor 
requested).
      */
     public static final Property<Duration> HEARTBEAT_REPLY_WAIT
-            = Property.durationSec("heartbeat-reply-wait", Duration.ZERO);
+            = Property.durationSec("heartbeat-reply-wait", 
Duration.ofMinutes(5));
 
     /**
      * Whether to ignore invalid identities files when pre-initializing the 
client session
@@ -275,7 +275,7 @@ public final class CoreModuleProperties {
      * Key used to retrieve the value of the socket read timeout for NIO2 
session implementation - in milliseconds.
      */
     public static final Property<Duration> NIO2_READ_TIMEOUT
-            = Property.duration("nio2-read-timeout", 
IDLE_TIMEOUT.getRequiredDefault().plus(Duration.ofSeconds(15L)));
+            = Property.duration("nio2-read-timeout", Duration.ZERO);
 
     /**
      * Minimum NIO2 write wait timeout for a single outgoing packet - in 
milliseconds
diff --git a/sshd-netty/pom.xml b/sshd-netty/pom.xml
index 50f492c..3c9595e 100644
--- a/sshd-netty/pom.xml
+++ b/sshd-netty/pom.xml
@@ -188,13 +188,13 @@
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
                     
<reportsDirectory>${project.build.directory}/surefire-reports-netty</reportsDirectory>
                     <excludes>
-                            <!-- These tests use NIO and/or MINA explicitly -->
+                        <!-- These tests use NIO and/or MINA explicitly -->
                         <exclude>**/*LoadTest.java</exclude>
                         <exclude>**/PortForwarding*Test.java</exclude>
                         <exclude>**/ProxyTest.java</exclude>
                         <exclude>**/Nio2ServiceTest.java</exclude>
 
-                            <!-- TODO need some more research as to why this 
fails on Netty but not on NIO2 or MINA -->
+                        <!-- TODO need some more research as to why this fails 
on Netty but not on NIO2 or MINA -->
                         <exclude>**/ClientDeadlockTest.java</exclude>
                         <exclude>**/AsyncAuthInteractiveTest.java</exclude>
                         <exclude>**/ApacheServer*Test.java</exclude>
@@ -203,8 +203,9 @@
                         
<exclude>**/BuiltinIoServiceFactoryFactoriesTest.java</exclude>
                         <exclude>**/ConcurrentConnectionTest.java</exclude>
                         <exclude>**/SignatureFactoriesTest.java</exclude>
+                        <exclude>**/Sshd1033Test.java</exclude>
                     </excludes>
-                        <!-- No need to re-run core tests that do not involve 
session creation -->
+                    <!-- No need to re-run core tests that do not involve 
session creation -->
                     
<excludedGroups>org.apache.sshd.util.test.NoIoTestCase</excludedGroups>
                 </configuration>
             </plugin>

Reply via email to