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

Jonathan Valliere commented on DIRMINA-1078:
--------------------------------------------

I’m on board with making this a whole new class of {{Executor}}.  It should not 
be the default behavior.  There rarely are one solution that fits all and I 
would not want to mess with the current {{Executor}} because there may be 
countless others which are extending the functionality in one way or another 
and adding this to the default would break all of the existing implementations.

Guss, what is the usage of {{FIFOEntry}}?  Isn't that redundant because the 
comparator will sort the {{IoSession}} objects?

> OrderedThreadPoolExecutor should allow sessions to be prioritized
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-1078
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1078
>             Project: MINA
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Guus der Kinderen
>            Priority: Major
>         Attachments: 20180216.patch
>
>
> The functionality provided in {{OrderedThreadPoolExecutor}} should be 
> augmented to, optionally, allow for assignment of priority to certain 
> sessions over others.
> We've introduced this functionality after observing issues in a deployment 
> where system resources where being starved by the sheer amount of sessions 
> that attempted to perform TLS. Without the class introduced by this commit, 
> events for any session could eventually fail (time-out), causing the session 
> to fail. If that session happened to be a session that had already 
> established TLS, the resources that were spent on establishing TLS are 
> wasted. The negative effect is amplified by the fact that a typical client in 
> such a situation would attempt
>  to reconnect, which further adds to the load of the system already being 
> starved.
> With the modifications introduced by the patch provided in this issue, 
> priority can be given to sessions that have already established TLS. This 
> dramatically reduces the issue described above, as the first sessions to fail 
> will be those that are still negotiating TLS. Using a specialized 
> {{Comparator}}, one can even prioritize between these, causing sessions for 
> which least effort has performed to fail before sessions that are more likely 
> to near TLS completion.
> The patch intends to add this feature as optional functionality to the 
> existing implementation, with little side effects to the existing, default 
> behavior.
> The implementation provided here was initially based on a copy of the 
> implementation of {{OrderedThreadPoolExecutor}} that introduced a 
> considerable amount of code duplication. For illustrative purposes, the line 
> of commits leading from that initial commit to the patch attached to this 
> JIRA issue can be found at 
> [https://github.com/guusdk/mina/commit/c0a421cf445696fbfd4d5b10d650d7c71d8faab7]
>  and later commits.



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

Reply via email to