[ 
https://issues.apache.org/jira/browse/SSHD-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15944678#comment-15944678
 ] 

ASF GitHub Bot commented on SSHD-734:
-------------------------------------

GitHub user grgrzybek opened a pull request:

    https://github.com/apache/mina-sshd/pull/30

    [SSHD-734] Attach session before starting sshd exchanges in ClientSes…

    …sionImpl constructor

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/grgrzybek/mina-sshd SSHD-734

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/mina-sshd/pull/30.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #30
    
----
commit 8bbe8522c4bb8e09c758899565b7fe57c6ae9b63
Author: Grzegorz Grzybek <gr.grzy...@gmail.com>
Date:   2017-03-28T07:23:55Z

    [SSHD-734] Attach session before starting sshd exchanges in 
ClientSessionImpl constructor

----


> When ClientSessionImpl construction fails, 
> AbstractSessionIoHandler#exceptionCaught may throw NPE
> -------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-734
>                 URL: https://issues.apache.org/jira/browse/SSHD-734
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Grzegorz Grzybek
>
> # {{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?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to