Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.0
-
None
Description
- org.apache.sshd.common.session.helpers.AbstractSession#sendKexInit() is called in ClientSessionImpl constructor
- org.apache.sshd.common.io.IoSession#write is called
- async write is done with handler created by org.apache.sshd.common.io.nio2.Nio2Session#createWriteCycleCompletionHandler()
- if e.g., sun.nio.ch.UnixAsynchronousSocketChannelImpl#implWrite() fails, it calls org.apache.sshd.common.io.nio2.Nio2CompletionHandler#onFailed()
- org.apache.sshd.common.io.nio2.Nio2Session#exceptionCaught() calls org.apache.sshd.common.io.IoHandler#exceptionCaught()
- org.apache.sshd.common.session.helpers.AbstractSessionIoHandler#exceptionCaught() can't find session in AbstractSession.getSession(ioSession, true)
- it throws throw new IllegalStateException("No session available", cause) instead of something more related to actual problem
The solution to "No session available" is simply to attach session in ClientSessionImpl constructor before starting sshd handshake
There's however more - how to propagate the exception from ClientSessionImpl constructor?
Attachments
Issue Links
- links to