Bug 43898 - recursive scp push may hang
Summary: recursive scp push may hang
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.7.0
Hardware: Other Linux
: P2 major (vote)
Target Milestone: 1.7.1
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-19 01:29 UTC by thomas gentsch
Modified: 2008-01-23 06:08 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thomas gentsch 2007-11-19 01:29:59 UTC
I have tried to transfer a directory structure consisting of a few files and
directories and after some items the transfer hangs.
I have debugged this and identified the SSH/SCP protocol phase where it got
stuck. I changed the code locally as in the attached patch, then it worked:

--- ./ScpToMessage.java-orig 2006-12-13 13:16:19.000000000 +0100
+++ ./ScpToMessage.java 2007-11-15 15:39:14.000000000 +0100
@@ -209,6 +209,7 @@
         waitForAck(in);
         sendDirectory(directory, in, out);
         out.write("E\n".getBytes());
+        out.flush();
         waitForAck(in);
     }
Comment 1 Anthony Bargnesi 2007-12-29 16:40:00 UTC
I have quite easily run into this bug in the same scenario that thomas did.  A
bug like this is disastrous because if you do not have verbose turned on you
will not see any file transfers at all, you will just see "Connecting to 'host'".

By building ant-jsch.jar in the manner thomas outlined, I was able to fix this.  
Comment 2 Andreas Hartmann 2008-01-23 04:26:12 UTC
I had the same problem, and Thomas' patch fixed it for me.
Comment 3 Peter Reilly 2008-01-23 06:08:13 UTC
Thanks for the update.
I have checked the code, and the current svn trunk and 1.7.1 branch
has the fix.
Ant 1.7.1 should be ready soon....