You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2017/05/22 16:19:15 UTC

[05/12] airavata git commit: adding logs to identify file transfer issue

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/7177cac6
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7177cac6
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7177cac6

Branch: refs/heads/develop
Commit: 7177cac6b247a525ee2a56bbe461e521134aba50
Parents: fc07b99
Author: Ajinkya Dhamnaskar <ad...@umail.iu.edu>
Authored: Tue Mar 7 15:14:23 2017 -0500
Committer: Ajinkya Dhamnaskar <ad...@umail.iu.edu>
Committed: Tue Mar 7 15:14:23 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/7177cac6/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;
 	}