You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/10/07 16:30:06 UTC

svn commit: r1763798 - in /tomcat/trunk/java/org/apache/catalina/webresources: Cache.java LocalStrings.properties

Author: markt
Date: Fri Oct  7 16:30:06 2016
New Revision: 1763798

URL: http://svn.apache.org/viewvc?rev=1763798&view=rev
Log:
Include Context name when cache addition fails.

Modified:
    tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
    tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/catalina/webresources/Cache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/Cache.java?rev=1763798&r1=1763797&r2=1763798&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/Cache.java (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/Cache.java Fri Oct  7 16:30:06 2016
@@ -97,15 +97,13 @@ public class Cache {
                     // efficiency (younger entries may be evicted before older
                     // ones) for speed since this is on the critical path for
                     // request processing
-                    long targetSize =
-                            maxSize * (100 - TARGET_FREE_PERCENT_GET) / 100;
-                    long newSize = evict(
-                            targetSize, resourceCache.values().iterator());
+                    long targetSize = maxSize * (100 - TARGET_FREE_PERCENT_GET) / 100;
+                    long newSize = evict(targetSize, resourceCache.values().iterator());
                     if (newSize > maxSize) {
                         // Unable to create sufficient space for this resource
                         // Remove it from the cache
                         removeCacheEntry(path);
-                        log.warn(sm.getString("cache.addFail", path));
+                        log.warn(sm.getString("cache.addFail", path, root.getContext().getName()));
                     }
                 }
             } else {
@@ -157,10 +155,8 @@ public class Cache {
                     // efficiency (younger entries may be evicted before older
                     // ones) for speed since this is on the critical path for
                     // request processing
-                    long targetSize =
-                            maxSize * (100 - TARGET_FREE_PERCENT_GET) / 100;
-                    long newSize = evict(
-                            targetSize, resourceCache.values().iterator());
+                    long targetSize = maxSize * (100 - TARGET_FREE_PERCENT_GET) / 100;
+                    long newSize = evict(targetSize, resourceCache.values().iterator());
                     if (newSize > maxSize) {
                         // Unable to create sufficient space for this resource
                         // Remove it from the cache

Modified: tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties?rev=1763798&r1=1763797&r2=1763798&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/webresources/LocalStrings.properties Fri Oct  7 16:30:06 2016
@@ -20,7 +20,7 @@ abstractResource.getContentTooLarge=Unab
 
 abstractResourceSet.checkPath=The requested path [{0}] is not valid. It must begin with "/".
 
-cache.addFail=Unable to add the resource at [{0}] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
+cache.addFail=Unable to add the resource at [{0}] to the cache for web application [{1}] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
 cache.backgroundEvictFail=The background cache eviction process was unable to free [{0}] percent of the cache for Context [{1}] - consider increasing the maximum size of the cache. After eviction approximately [{2}] KB of data remained in the cache.
 cache.objectMaxSizeTooBig=The value of [{0}]kB for objectMaxSize is larger than the limit of maxSize/20 so has been reduced to [{1}]kB
 cache.objectMaxSizeTooBigBytes=The value specified for the maximum object size to cache [{0}]kB is greater than Integer.MAX_VALUE bytes which is the maximum size that can be cached. The limit will be set to Integer.MAX_VALUE bytes.



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