Hello Piotr Kliczewski,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/23207

to review the following change.

Change subject: host-deploy: ssh: flush pipes at end of command
......................................................................

host-deploy: ssh: flush pipes at end of command

the apache-sshd does not flush streams nor close them
this leads other side of pipe to miss last bytes

Change-Id: I0034105c473d6102283bb67d272fca2bc78f7863
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1052137
Reported-By: Piotr Kliczewski <pklic...@redhat.com>
Tested-By: Piotr Kliczewski <pklic...@redhat.com>
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
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
2 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/23207/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 1ea6cc0..3c6e04a 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
@@ -717,6 +717,12 @@
                 remoteDigest
             );
 
+            // the apache-sshd does not
+            // flush streams nor close them
+            // this leads other side of pipe
+            // to miss last bytes
+            pout.flush();
+
             t.join(THREAD_JOIN_WAIT_TIME);
             if (t.getState() != Thread.State.TERMINATED) {
                 throw new IllegalStateException("Cannot stop SSH stream 
thread");
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
index 38ad759..461576c 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
@@ -314,6 +314,12 @@
                     poutStdout,
                     stderr
                 );
+
+                // the apache-sshd does not
+                // flush streams nor close them
+                // this leads other side of pipe
+                // to miss last bytes
+                poutStdout.flush();
             }
             catch (Exception e) {
                 if (stderr.size() == 0) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0034105c473d6102283bb67d272fca2bc78f7863
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to