Hi jsch-team,

thanks a lot for the great library!

I have one problem. When Thread.interrupt() is called while there is a sftp
connection running I get errors like:
Caused by: 4:
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1751)
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1011)
 at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:989)
at
org.eclipse.ptp.remotetools.internal.ssh.FileTools.getInputStream(FileTools.java:284)
 ... 81 more
Caused by: java.io.InterruptedIOException
at java.io.PipedInputStream.read(PipedInputStream.java:312)
 at java.io.PipedInputStream.read(PipedInputStream.java:361)
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2325)
 at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2351)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1732)

Is this this behavior intended?

My understanding is that a channel (like ChannelSFTP) should either:
1) Ignore InterruptedException, complete the IO operation and then setting
the  thread's interrupt status.
2) Throw InterruptedIOException
3) Implement InterruptibleChannel as e.g. java.nio.channels.FileChannel  and
gracefully close the channel and throw a ClosedByInterruptException

At the moment it seems to throw a SftpException without a message indicating
that it got interrupted.

IMHO, the best would be if one could choose when opening a channel wither it
should behave like 1 or like 3.

Thanks
Roland



-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to