DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36594>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36594


[EMAIL PROTECTED] changed:

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




------- Additional Comments From [EMAIL PROTECTED]  2005-09-12 12:56 -------
I applied the patch. Thanks a lot since it would have been impossible to debug
without knowing the exact usage.

The case where insertCache "fails" because the entry is already present is a
race condition on allocate and insert, so it would be best if another lookup
under sync should be performed before trying (to avoid the uneeded allocate):

Index: ProxyDirContext.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/resources/ProxyDirContext.java,v
retrieving revision 1.18
diff -u -r1.18 ProxyDirContext.java
--- ProxyDirContext.java        20 Jul 2005 21:25:18 -0000      1.18
+++ ProxyDirContext.java        12 Sep 2005 10:43:35 -0000
@@ -1596,7 +1596,7 @@
         // Add new entry to cache
         synchronized (cache) {
             // Check cache size, and remove elements if too big
-            if (cache.allocate(entry.size)) {
+            if ((cache.lookup(name) == null) && cache.allocate(entry.size)) {
                 cache.load(entry);
             }
         }


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to