[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17143223#comment-17143223 ] James Lentini commented on VFS-627: --- A recent post on the JSch mailing list about forking the project so that it can be maintained: [https://sourceforge.net/p/jsch/mailman/message/37044268/] > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream) > @bci=5, line=865 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17047867#comment-17047867 ] Gary D. Gregory commented on VFS-627: - Are there opinions on replacing Jsch with sshj? > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream) > @bci=5, line=865 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(org.apache.commons.vfs2.FileContent) > @bci=9, line=828
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046982#comment-17046982 ] James Lentini commented on VFS-627: --- Regarding: {quote}Do you see that with a specific kind of server software or multiple? {quote} Although I've only tested against an OpenSSH server, I believe the issue is in the Jsch client and is not specific to its interaction with a particular SFTP server implementation. Thanks for the pointer to sshj. > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046926#comment-17046926 ] Otto Fowler commented on VFS-627: - Apache Nifi has switch to the sshj library: https://github.com/apache/nifi/pull/3726/files > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream) > @bci=5, line=865 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046874#comment-17046874 ] Bernd Eckenfels commented on VFS-627: - Haven't seen another provider for VFS which does SFTP, sorry. I am afraid this requires and inspecting the protocol messages by somebody who knows the protocol well. Do you see that with a specific kind of server software or multiple? > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17046849#comment-17046849 ] James Lentini commented on VFS-627: --- Hi [~b.eckenfels], I didn't receive a response to the [message|https://sourceforge.net/p/jsch/mailman/message/36872566/] that I posted 2+ months ago on the jsch-users mailing list. Maybe nobody is reading that email list anymore? Does anyone on the Apache VFS project know how to get in touch with the folks at Jcraft? Alternatively, is there an alternative SFTP provider for VFS? > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16989784#comment-16989784 ] James Lentini commented on VFS-627: --- Hi [~b.eckenfels], leaving this open makes sense to me. I'll post here when I hear back from the JSch project. > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream) > @bci=5, line=865 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16989694#comment-16989694 ] Bernd Eckenfels commented on VFS-627: - Thanks james for debugging this. I guess we keep this bug around till we JSch has fixed it and we upgraded to that version. > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream) > @bci=5, line=865 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16989683#comment-16989683 ] James Lentini commented on VFS-627: --- I root caused the issue and found a deadlock in JSch. My analysis of the problem and a simple test program to reproduce the issue are at: [https://github.com/jlentini/SftpCopyDeadlock] I also posted a patch to fix the issue to the jsch-users mailing list in this [message|https://sourceforge.net/p/jsch/mailman/message/36872566/]. Note that there is a workaround: use two {{org.apache.commons.vfs2 FileSystemManager}} instances, one for the source file and one for the destination file. > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg >Priority: Major > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > -
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16041674#comment-16041674 ] Bernd Eckenfels commented on VFS-627: - [~aditya0403] Could you please provide multiple "jstack -l" invocation results (with a few seconds in between) and the full stack trace of the seemingly blocking operation. Can you also provide "netstat -t" on client and server (and tell us wich established TCP connection it is). > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - > org.apache.commons.vfs2.provider.DefaultFileContent.write(java.io.OutputStream, > int) @bci=35, line=892 (Compiled frame) > - >
[jira] [Commented] (VFS-627) SFTP randomly hangs when copying a file on remote server
[ https://issues.apache.org/jira/browse/VFS-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16040745#comment-16040745 ] Aditya Kunkolienkar commented on VFS-627: - I am facing similar issue where it gets stuck in DefaultFileContent line number 894. It gets stuck in below while loop after few iterations: final byte[] buffer = new byte[bufferSize]; int n = 0; while (-1 != (n = input.read(buffer))) { output.write(buffer, 0, n); count += n; } > SFTP randomly hangs when copying a file on remote server > > > Key: VFS-627 > URL: https://issues.apache.org/jira/browse/VFS-627 > Project: Commons VFS > Issue Type: Bug >Affects Versions: 2.1 > Environment: Java 1.8.0_92 > VFS 2.1 > JSch 0.1.53 >Reporter: Henri Hagberg > > I have a process where a file is first copied over SFTP to local server and > then on the remote server the file is copied to another location on that > server for archiving. Both are done using {{FileObject#copyFrom}}. Now I've > encountered twice the situation where during archiving (on remote server) the > copy action hangs indefinitely (the process was left running for over 24 > hours). In both cases the issue happened when around 2000 files had been > transferred (typical amount is under 100). > The problem is difficult to reproduce since it doesn't always happen even > with large number of files. Based on the stacktrace and random occurrences it > might be a concurrency issue. The code using VFS however is single threaded. > {code} > Attaching to process ID 128021, please wait... > Debugger attached successfully. > Server compiler detected. > JVM version is 25.92-b14 > Deadlock Detection: > No deadlocks found. > Thread 19073: (state = BLOCKED) > Thread 128165: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - org.apache.commons.vfs2.cache.SoftRefFilesCache$SoftRefReleaseThread.run() > @bci=26, line=84 (Compiled frame) > Thread 128164: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.io.PipedInputStream.awaitSpace() @bci=23, line=273 (Compiled frame) > - java.io.PipedInputStream.receive(byte[], int, int) @bci=31, line=231 > (Compiled frame) > - java.io.PipedOutputStream.write(byte[], int, int) @bci=77, line=149 > (Compiled frame) > - com.jcraft.jsch.IO.put(byte[], int, int) @bci=7, line=64 (Compiled frame) > - com.jcraft.jsch.Channel.write(byte[], int, int) @bci=7, line=438 (Compiled > frame) > - com.jcraft.jsch.Session.run() @bci=1260, line=1624 (Compiled frame) > - java.lang.Thread.run() @bci=11, line=745 (Interpreted frame) > Thread 128139: (state = BLOCKED) > Thread 128138: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.ref.ReferenceQueue.remove(long) @bci=59, line=143 (Compiled > frame) > - java.lang.ref.ReferenceQueue.remove() @bci=2, line=164 (Compiled frame) > - java.lang.ref.Finalizer$FinalizerThread.run() @bci=36, line=209 > (Interpreted frame) > Thread 128137: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - java.lang.Object.wait() @bci=2, line=502 (Compiled frame) > - java.lang.ref.Reference.tryHandlePending(boolean) @bci=54, line=191 > (Compiled frame) > - java.lang.ref.Reference$ReferenceHandler.run() @bci=1, line=153 > (Interpreted frame) > Thread 128022: (state = BLOCKED) > - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be > imprecise) > - com.jcraft.jsch.Session.write(com.jcraft.jsch.Packet, > com.jcraft.jsch.Channel, int) @bci=89, line=1261 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.sendWRITE(byte[], long, byte[], int, int) > @bci=191, line=2619 (Compiled frame) > - com.jcraft.jsch.ChannelSftp.access$100(com.jcraft.jsch.ChannelSftp, > byte[], long, byte[], int, int) @bci=9, line=36 (Compiled frame) > - com.jcraft.jsch.ChannelSftp$1.write(byte[], int, int) @bci=77, line=791 > (Compiled frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=122 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - java.io.BufferedOutputStream.flushBuffer() @bci=20, line=82 (Compiled > frame) > - java.io.BufferedOutputStream.write(byte[], int, int) @bci=39, line=126 > (Compiled frame) > - org.apache.commons.vfs2.util.MonitorOutputStream.write(byte[], int, int) > @bci=8, line=123 (Compiled frame) > - >