You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/12/28 17:45:11 UTC

DO NOT REPLY [Bug 46193] Potential Thread problem with SessionManager

https://issues.apache.org/bugzilla/show_bug.cgi?id=46193


Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Konstantin Kolinko <kn...@gmail.com>  2008-12-28 08:45:09 PST ---
It is JDK issue, not Tomcat one.

As said in the class summary ([1]) (and the JavaDoc serves as the official spec
for the class), this class is designed to be a replacement for
java.util.Hashtable. If the implementation does not behave, it is not Tomcat to
blame.

[1]
http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html

The first stacktrace of yours is a ConcurentHashMap.values().toArray(T[]) call,
the second one is ConcurentHashMap.remove(Object). The both ones are valid API
calls.

The second one is failing due to unpaired lock() / unlock() calls inside a
segment of ConcurentHashMap. All those call pairs are internal to
ConcurentHashMap implementation and do not span more that one API method call.

The first one is specifically addressed in Sun JDK implementation of
AbstractCollection.toArray(), see bug 5067025 [2] for the date when it was
spotted and fixed.

[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5067025

I wonder, why you are still seeing such issues, as ConcurentHashMap class is
available since JDK 5.0 and should have been well tested in practice since
then. It might be there is something more subtle, specific to your CPU /
libraries, or else it is a regression, and there are good chances that it is
already fixed.

You may try to solve the issue with your JDK vendor.

> * However, iterators are
> * designed to be used by only one thread at a time.

It does not apply to your stack traces. There is a toArray() API call. Well,
most if not all iterators are to be used by only one thread at a time.


-- 
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