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

The IoServiceStatistics methods are called for every new session creation

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: 2.0.8
    • Component/s: None
    • Labels:
      None

      Description

      When a session is established, some methods of the IoServiceStatistics class are called :

      protected final void finishSessionInitialization(IoSession session, IoFuture future, IoSessionInitializer sessionInitializer) {
      if (stats.getLastReadTime() == 0) {
      ((IoServiceStatistics)stats).setLastReadTime(getActivationTime());

      There are two problems with this approach :

      • first, many of the members of this classes are not thread safe, leading to some random value potentially be put into the stats instance for the service
      • second, if we protect those members using some synchronization (or volatile data), it might slow down the connection initialization.

      The IoServiceStatistics class should be thread safe, and these statistics should not be updated if the user don't want them, ie, it should be optionnal (the Configuration object should take care of this)

        Issue Links

          Activity

          Hide
          elecharny Emmanuel Lecharny added a comment -

          Not really a bug ...

          Show
          elecharny Emmanuel Lecharny added a comment - Not really a bug ...
          Hide
          elecharny Emmanuel Lecharny added a comment -

          Not urgent either... 3.0

          Show
          elecharny Emmanuel Lecharny added a comment - Not urgent either... 3.0
          Hide
          elecharny Emmanuel Lecharny added a comment -

          Fix with commit e0da8d7fdecf9d412063089b860a960caa0795bf

          Show
          elecharny Emmanuel Lecharny added a comment - Fix with commit e0da8d7fdecf9d412063089b860a960caa0795bf

            People

            • Assignee:
              Unassigned
              Reporter:
              elecharny Emmanuel Lecharny
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development