Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket timeout is ignored when changing directory #788

Open
cd-ppi opened this issue Mar 6, 2025 · 0 comments
Open

Socket timeout is ignored when changing directory #788

cd-ppi opened this issue Mar 6, 2025 · 0 comments

Comments

@cd-ppi
Copy link

cd-ppi commented Mar 6, 2025

I'm calling ChannelSftp.cd(Path) on a session that has a timeout of five seconds, then make sure that the SFTP-Server does not answer, but also does not break the connection. The execution of the client hangs in the read loop of the PipedInputStream:
java.lang.Thread.State: WAITING
at java.lang.Object.wait(Object.java:-1)
at java.io.PipedInputStream.read(PipedInputStream.java:326)
at java.io.PipedInputStream.read(PipedInputStream.java:377)
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2866)
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2894)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2149)
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:331)
at my.App.changeDirViaSftp(SftpProvider.java:621)

(You mostly catch it in the wait if you pause the thread, but it really loops the whole time). It seems that it can't be easily helped, since the PipedInputStream does not implement any timeout.

I would expect the timeout to have some effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant