https://bz.apache.org/bugzilla/show_bug.cgi?id=62168

            Bug ID: 62168
           Summary: PersistentManager.minIdleSwap=-1 does not disable
                    swapping as documented.
           Product: Tomcat 9
           Version: 9.0.5
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: -----

Created attachment 35758
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35758&action=edit
Patch against Apache Tomcat trunk r1826332

Hello,

Documentation says:

minIdleSwap     
-----------
The minimum time in seconds a session must be idle before it is eligible to be
swapped to disk to keep the active session count below maxActiveSessions.
Setting to -1 means sessions will not be swapped out to keep the active session
count down. If specified, this value should be less than that specified by
maxIdleSwap. By default, this value is set to -1.


The sentence "Setting to -1 means sessions will not be swapped out to keep the
active session count down." is not true: sessions are swapped when
maxActiveSessions is reached even if minIdleSwap is -1.

The Method
/**
 * Swap idle sessions out to Store if too many are active
*/
org.apache.catalina.session.PersistentManagerBase.processMaxActiveSwaps()

does not consider the minIdleSwap < 0 case, but simply swaps out sessions if
(timeIdle >= minIdleSwap) which behaves just like setting minIdleSwap=0.

This way, the manager likely swaps sessions that are still quite active at that
moment in contrast of the administrators' intention who wantet to disable this
feature.

I suggest attached patch to fix this.

Kind regards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to