Bug 1302555 - [GSS](6.4.z) active-sessions can exceed max-active-sessions due to a race condition
[GSS](6.4.z) active-sessions can exceed max-active-sessions due to a race con...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web (Show other bugs)
6.4.5
Unspecified Unspecified
unspecified Severity unspecified
: CR1
: EAP 6.4.7
Assigned To: Chao Wang
Radim Hatlapatka
:
Depends On:
Blocks: eap647-payload 1308845
  Show dependency treegraph
 
Reported: 2016-01-28 02:28 EST by Osamu Nagano
Modified: 2017-01-17 07:00 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-17 07:00:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache Bugzilla 48790 None None None 2016-01-28 02:30 EST
Red Hat Knowledge Base (Solution) 2164441 None None None 2016-03-07 19:43 EST

  None (edit)
Description Osamu Nagano 2016-01-28 02:28:05 EST
Below is the original bug report for Tomcat.  JBoss Web missed it for a long time.

[Bug 48790 - Race condition in org.apache.catalina.session.ManagerBase:maxActive]
https://bz.apache.org/bugzilla/show_bug.cgi?id=48790


Actual:
http://anonsvn.jboss.org/repos/jbossweb/trunk/src/main/java/org/apache/catalina/session/ManagerBase.java
~~~
    public void add(Session session) {

        sessions.put(session.getIdInternal(), session);
        int size = sessions.size();
        if( size > maxActive ) {
            maxActive = size;
        }
    }
~~~


Expected:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java
~~~
    public void add(Session session) {

        sessions.put(session.getIdInternal(), session);
        int size = sessions.size();
        if( size > maxActive ) {
            synchronized(maxActiveUpdateLock) {
                if( size > maxActive ) {
                    maxActive = size;
                }
            }
        }
    }
~~~
Comment 6 Michael Cada 2016-03-11 09:43:15 EST
Verified on EAP 6.4.7.CP.CR2

Verified that max-active-sessions is never smaller than active-sessions (it's now synchronized), but active-sessions can exceed property MAX_ACTIVE_SESSIONS see bz#1316949 and if property MAX_ACTIVE_SESSIONS is set from jboss-web.xml it doesn't work - see bz#1316960
Comment 7 Petr Penicka 2017-01-17 07:00:44 EST
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Note You need to log in before you can comment on or make changes to this bug.