Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1078

OrderedThreadPoolExecutor should allow sessions to be prioritized

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      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.

        Attachments

        1. 20180216.patch
          12 kB
          Guus der Kinderen
        2. 20180706.patch
          40 kB
          Guus der Kinderen

          Activity

            People

            • Assignee:
              johnnyv Jonathan Valliere
              Reporter:
              guus.der.kinderen Guus der Kinderen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: