tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46193] New: Potential Thread problem with SessionManager
Date Wed, 12 Nov 2008 11:56:37 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46193

           Summary: Potential Thread problem with SessionManager
           Product: Tomcat 6
           Version: 6.0.16
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: hgomez@apache.org


Hi to all,

Under heavly load (about 500k/requests by day), I see this error about
30 times last week on a Tomcat 6.0.16 (with libtcnative 1.1.14 on a
Suse SLES 10 and IBM JDK 1.6-jvmxi3260-20080415_18762).

We have many HTTP sessions on our application and so frequent session cleanup
done by Tomcat.

We see theses errors :

WARNING: Exception processing manager
org.apache.catalina.session.StandardManager@66196619 background
process
Throwable occurred: java.lang.ArrayIndexOutOfBoundsException
       at java.util.AbstractCollection.toArray(Unknown Source)
       at
org.apache.catalina.session.ManagerBase.findSessions(ManagerBase.java:873)
       at
org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:676)
       at
org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667)
       at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
       at java.lang.Thread.run(Thread.java:735)
7 nov. 2008 16:18:21 org.apache.catalina.core.ContainerBase backgroundProcess

---

WARNING: Exception processing manager
org.apache.catalina.session.StandardManager@66196619 background
process
Throwable occurred: java.lang.IllegalMonitorStateException
       at
java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:140)
       at
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1188)
       at
java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:444)
       at
java.util.concurrent.ConcurrentHashMap$Segment.remove(ConcurrentHashMap.java:555)
       at
java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:936)
       at org.apache.catalina.session.ManagerBase.remove(ManagerBase.java:885)
       at
org.apache.catalina.session.StandardSession.expire(StandardSession.java:743)
       at
org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
       at
org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:682)
       at
org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667)
       at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
       at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
       at java.lang.Thread.run(Thread.java:735)


We take a look at ManagerBase and the sessions is using ConcurrentHashMap.

We wonder if they couldn't be some Concurrency problems when some threads are
updating the sessions Map while ManagerBase try to dump the sessions into
sessions array in findSessions.

>From ConcurrentHashMap comments :

 * Enumerations return elements reflecting the state of the hash table
 * at some point at or since the creation of the iterator/enumeration.
 * They do <em>not</em> throw
 * {@link ConcurrentModificationException}.  However, iterators are
 * designed to be used by only one thread at a time.


Regards


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message