You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Goldstein Lyor (JIRA)" <ji...@apache.org> on 2016/02/20 11:42:18 UTC

[jira] [Commented] (SSHD-651) Add an option to specify read/write Nio2 socket timeouts

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

Goldstein Lyor commented on SSHD-651:
-------------------------------------

Implementing this for NIO2 is not too difficult. However, there are a few questions to be resolved:

* What would be a reasonable default for the read/write timeouts ?

This question is especially crucial for read timeout where the SSH session may be very quiet,

* Should we use the _FactoryManager#DEFAULT_IDLE_TIMEOUT_  (default=10min.) ? 

In this context what you describe seems very strange in view of the SSH session idle timeout mechanism which closes inactive sessions. So the "dangling" connections you mention seem very strange - I would strongly recommended opening up the DEBUG log level (at lease for the _AbstractSession_) and seeing what happens in this regard.

* For write timeouts - shouldn't the timeout be proportional to the amount of data being written ?

If so, what would be a good formula to calculate it...

* The above only holds for NIO2 - what if the user is using MINA sessions ?

The behavior of the code would change from the user's perspective - do you suggest we implement a timeout thread mechanism for MINA sessions that enforces the same read/write behavior as NIO2 - possible, but not tririval piece of code...

* Have you made sure that the "dangling" connections you mention are not related to DIRMINA-1021 (a.k.a. SSHD-595) ?

Bottom line - we need a clearer definition of this feature's behavior before implementing it.

> Add an option to specify read/write Nio2 socket timeouts
> --------------------------------------------------------
>
>                 Key: SSHD-651
>                 URL: https://issues.apache.org/jira/browse/SSHD-651
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Eugene Petrenko
>            Assignee: Goldstein Lyor
>
> Currently, as I see from Nio2Acceptor and Nio2Session code we call socket async read/write without specifying ant timeouts. This may mean that for some cases this read/write may stuck eternally. 
> Currently I see such dangling connections on my application. 
> It could be nice if we were ably to pass some fixed timeout for low-level socket operations. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)