Hello Piotr Kliczewski,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/23102
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=1051035
Reported-By: Piotr Kliczewski <[email protected]>
Tested-By: Piotr Kliczewski <[email protected]>
Signed-off-by: Alon Bar-Lev <[email protected]>
---
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/02/23102/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 189d166..143ecfa 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
@@ -710,6 +710,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 98959f2..633af12 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
@@ -320,6 +320,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/23102
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0034105c473d6102283bb67d272fca2bc78f7863
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches