[ 
https://issues.apache.org/jira/browse/SSHD-851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roberto Deandrea resolved SSHD-851.
-----------------------------------
    Resolution: Implemented

Hi Lyor,
We found a definitive solution for this problem. 
My pull request is :
https://github.com/apache/mina-sshd/pull/73/commits/d2d8d84293c5c50413747cc7ab00217d16e8f39e

Let us know if this cod change can be merged in Apache SSHD master repository?

Cheers
Roberto


> Last chunk of data lost into local port forwarding channel
> ----------------------------------------------------------
>
>                 Key: SSHD-851
>                 URL: https://issues.apache.org/jira/browse/SSHD-851
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.1.1
>            Reporter: Roberto Deandrea
>            Priority: Major
>         Attachments: sshd.agent.trace
>
>
> Hi Lyor,
> I found another problem transferring data through a local port forwarding 
> channel.
> It seems that the problem is located into Apache SSHD server code according 
> to me.
> All the data are transferred from the originating client to the Apache SSH 
> client and then go to the SSHD server through a local port forwarding channel.
> When the client stops sending data, and the channel is being closed,  the 
> SSHD server fail to send the last chunk of data to the target destination.
> In the attached trace file the problem is isolated as the following:
> *local port forwarding channel : [id=732 recipient=732]*
> *Nio2Session[local=/0:0:0:0:0:0:0:0:50047, remote=/192.168.2.107:62284 
> session against target server*
> Looking through the traces I see that when the local port forwarding channel 
> is closed, the Nio2Session against the target server is closed gracefully, 
> but instead of waiting to complete pending socket writes to the target server 
> the Nio2Session is then closed immediately causing write failures.
> In the traces I see:
> 2018-10-16 16:20:19,167 DEBUG [xdmzdriverssh@/192.168.10.34:55335]]-thread-1] 
> [AbstractCloseable.close] close(Nio2Session[local=/0:0:0:0:0:0:0:0:50047, 
> remote=/192.168.2.107:62284]) Closing gracefully
> 2018-10-16 16:20:19,167 DEBUG [xdmzdriverssh@/192.168.10.34:55335]]-thread-2] 
> [AbstractCloseable.close] 
> close(org.apache.sshd.common.io.nio2.Nio2Connector@77fcff14) Closing 
> immediately^M
> 2018-10-16 16:20:19,167 DEBUG [xdmzdriverssh@/192.168.10.34:55335]]-thread-2] 
> [AbstractCloseable.close] close(Nio2Session[local=/0:0:0:0:0:0:0:0:50047, 
> remote=/192.168.2.107:62284]) Closing immediately
> After that  I see:
> 2018-10-16 16:20:19,167 DEBUG [xdmzdriverssh@/192.168.10.34:55335]]-thread-2] 
> [Nio2Session.doCloseImmediately] 
> doCloseImmediately(Nio2Session[local=/0:0:0:0:0:0:0:0:50047, 
> remote=/192.168.2.107:62284]) signal write abort for 
> future=Nio2DefaultIoWriteFuture[id=/192.168.2.107:62284][value=null]
> 2018-10-16 16:20:19,167 DEBUG [xdmzdriverssh@/192.168.10.34:55335]]-thread-2] 
> [TcpipServerChannel.handleWriteDataFailure] 
> handleWriteDataFailure(TcpipServerChannel[id=732, 
> recipient=732]-ServerSessionImpl[aixdmzdriverssh@/192.168.10.34:55335])[SSH_MSG_CHANNEL_DATA]
>  failed (WriteAbortedException) to write len=16384: Write request aborted due 
> to immediate session close
>  
> These errors are repeated multiple times.
> The sum of bytes not written are equal to the chunk of data missing ad the 
> target server.
> Can you troubleshoot this problem?
> Let me know if you need more info.
>  
> Cheers
> Roberto
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to