adding logs to identify file transfer issue
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/1306097c Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/1306097c Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/1306097c Branch: refs/heads/develop Commit: 1306097cf632035a4c5ed1b22bd3b5d43499e6a6 Parents: bf23eae Author: Ajinkya Dhamnaskar <[email protected]> Authored: Tue Mar 7 15:14:23 2017 -0500 Committer: scnakandala <[email protected]> Committed: Tue Mar 7 17:15:52 2017 -0500 ---------------------------------------------------------------------- .../java/org/apache/airavata/gfac/impl/SSHUtils.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/1306097c/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java index ace8e1b..60fc2d3 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/SSHUtils.java @@ -293,7 +293,6 @@ public class SSHUtils { sin = sourceChannel.getInputStream(); sourceChannel.connect(); - boolean ptimestamp = true; // exec 'scp -t destinationFile' String command = "scp " + (ptimestamp ? "-p" : "") + " -t " + destinationFile; @@ -320,6 +319,8 @@ public class SSHUtils { sout.write(buf, 0, 1); sout.flush(); + log.info("Initiating transfer from:" + sourceFile + " To: " + destinationFile + ", Ignore Empty file : " + ignoreEmptyFile); + while (true) { int c = checkAck(sin); if (c != 'C') { @@ -347,6 +348,14 @@ public class SSHUtils { break; } } + + //FIXME: Remove me after fixing file transfer issue + if(fileSize == 0L){ + log.warn("*****Zero byte file*****. Transferring from:" + sourceFile + " To: " + destinationFile + ", File Size : " + fileSize + ", Ignore Empty file : " + ignoreEmptyFile); + }else{ + log.info("Transferring from:" + sourceFile + " To: " + destinationFile + ", File Size : " + fileSize + ", Ignore Empty file : " + ignoreEmptyFile); + } + if (fileSize == 0L && !ignoreEmptyFile){ String error = "Input file is empty..."; log.error(error); @@ -505,12 +514,14 @@ public class SSHUtils { sb.append((char) c); } while (c != '\n'); + //FIXME: Redundant if (b == 1) { // error System.out.print(sb.toString()); } if (b == 2) { // fatal error System.out.print(sb.toString()); } + log.warn(sb.toString()); } return b; }
