Bug 1302555 - [GSS](6.4.z) active-sessions can exceed max-active-sessions due to a race condition
Summary: [GSS](6.4.z) active-sessions can exceed max-active-sessions due to a race con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.7
Assignee: Chao Wang
QA Contact: Radim Hatlapatka
URL:
Whiteboard:
Depends On:
Blocks: eap647-payload 1308845
TreeView+ depends on / blocked
 
Reported: 2016-01-28 07:28 UTC by Osamu Nagano
Modified: 2019-09-12 09:51 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 12:00:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 48790 0 None None None 2016-01-28 07:30:22 UTC
Red Hat Knowledge Base (Solution) 2164441 0 None None None 2016-03-08 00:43:57 UTC

Description Osamu Nagano 2016-01-28 07:28:05 UTC
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 14:43:15 UTC
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 12:00:44 UTC
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.