Piotr Kliczewski has posted comments on this change.

Change subject: utils: ssh: force close the pipe before the layered stream
......................................................................


Patch Set 1:

(1 comment)

Please see my comment in the code about ordering.

....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
Line 594:             final InputStream in = new DigestInputStream(
Line 595:                 new FileInputStream(file1),
Line 596:                 localDigest
Line 597:             );
Line 598:             final PipedInputStream pin = new 
PipedInputStream(STREAM_BUFFER_SIZE);
I see the order of closing here knowing that the order is reversed:
Was:
1. remoteDigest
2. dummy
3. pout
4. pin

After the change:
1. pout
2. remoteDigest
3. dummy
4. pin

Other changes have similar ordering change.
Line 599:             final OutputStream dummy = new 
ConstraintByteArrayOutputStream(CONSTRAINT_BUFFER_SIZE);
Line 600:             final ByteArrayOutputStream remoteDigest = new 
ConstraintByteArrayOutputStream(CONSTRAINT_BUFFER_SIZE);
Line 601:         ) {
Line 602:             try (final OutputStream pout = new 
PipedOutputStream(pin)) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I485f5ae57a963b6819fdc0f3832eaa403dc0c34d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to