Alon Bar-Lev has uploaded a new change for review.

Change subject: utils: ssh: fixup activity detection
......................................................................

utils: ssh: fixup activity detection

Current implementation considers only the first active stream, leaving
other streams marked as active.

Activity detection should clear all streams' activity flag at every loop
iteration.

Change-Id: Ibb63134b2829ae57c902f9d3c33f10c5311bcf76
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
1 file changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/9169/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
index faf64ee..ff1494b 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
@@ -439,6 +439,7 @@
 
             boolean hardTimeout = false;
             int stat;
+            boolean activity;
             do {
                 stat = channel.waitFor(
                     (
@@ -450,14 +451,18 @@
                 );
 
                 hardTimeout = (hardEnd != 0 && System.currentTimeMillis() >= 
hardEnd);
+
+                /*
+                 * Notice that we should visit all
+                 * so do not cascade statement.
+                 */
+                activity = iin.wasProgress();
+                activity = iout.wasProgress() || activity;
+                activity = ierr.wasProgress() || activity;
             } while(
                 !hardTimeout &&
                 (stat & ClientChannel.TIMEOUT) != 0 &&
-                (
-                    iin.wasProgress() ||
-                    iout.wasProgress() ||
-                    ierr.wasProgress()
-                )
+                activity
             );
 
             if (hardTimeout) {


--
To view, visit http://gerrit.ovirt.org/9169
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb63134b2829ae57c902f9d3c33f10c5311bcf76
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to