hierynomus / sshj

ssh, scp and sftp for java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken pipe errors after upgrading to 0.36.0

dkocher opened this issue · comments

After upgrading from 0.35.0 to 0.36.0 I see the following failures on the transport socket when sending write requests in integration tests.

2023-09-05 18:02:45,767 [sshj-Reader-localhost/127.0.0.1:2202-1693929765710] ERROR net.schmizz.sshj.transport.TransportImpl - Dying because - Connection reset
java.net.SocketException: Connection reset
	at sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:323) ~[?:?]
	at sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350) ~[?:?]
	at sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803) ~[?:?]
	at java.net.Socket$SocketInputStream.read(Socket.java:982) ~[?:?]
	at net.schmizz.sshj.transport.Reader.run(Reader.java:50) [sshj-0.36.0.jar:?]

Ai, that does not sound well. Could you try adding an integration test to reproduce this in the project?

I'm also seeing this issue when transferring files with SCP, but only with certain files. If I downgrade to 0.35.0 it goes away

I just made a PR with an integrationtest reproducing this bug. It seems like using compression (more precisely the net.schmizz.sshj.transport.compression.DelayedZlibCompression) breaks the connection here. This is probably related to #772

@maltesmann Thanks for the test!

@dkocher @ericparton Can you try whether the change in #901 resolves your issues?

I'll keep this one open for a bit longer until @dkocher and/or @ericparton responded, but the PR has been merged already as it fixed the broken test ;)

I'll keep this one open for a bit longer until @dkocher and/or @ericparton responded, but the PR has been merged already as it fixed the broken test ;)

🎉 I can no longer reproduce with 5d040dd.