commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1769582 - in /commons/proper/pool/trunk/src: changes/changes.xml main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Date Mon, 14 Nov 2016 09:44:18 GMT
Author: markt
Date: Mon Nov 14 09:44:18 2016
New Revision: 1769582

URL: http://svn.apache.org/viewvc?rev=1769582&view=rev
Log:
Additional fix for POOL-315.
Thanks to Keiichi Fujino
Also review previous fix.

Modified:
    commons/proper/pool/trunk/src/changes/changes.xml
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java

Modified: commons/proper/pool/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/changes/changes.xml?rev=1769582&r1=1769581&r2=1769582&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/changes/changes.xml (original)
+++ commons/proper/pool/trunk/src/changes/changes.xml Mon Nov 14 09:44:18 2016
@@ -71,7 +71,7 @@ The <action> type attribute can be add,u
       Ensure that any class name used for evictionPolicyClassName represents a
       class that implements EvictionPolicy.
     </action>
-    <action dev="markt" issue="POOL-315" type="fix">
+    <action dev="markt" issue="POOL-315" type="fix" due-to="KeiichiFujino">
       Add a configurable delay (default 10 seconds) to wait when shutting down
       an Evictor to allow the associated thread time to complete and current
       evictions and to terminate.

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java?rev=1769582&r1=1769581&r2=1769582&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java
Mon Nov 14 09:44:18 2016
@@ -88,7 +88,7 @@ public abstract class BaseGenericObjectP
     private volatile long softMinEvictableIdleTimeMillis =
             BaseObjectPoolConfig.DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS;
     private volatile EvictionPolicy<T> evictionPolicy;
-    private long evictorShutdownTimeoutMillis =
+    private volatile long evictorShutdownTimeoutMillis =
             BaseObjectPoolConfig.DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS;
 
 
@@ -643,7 +643,7 @@ public abstract class BaseGenericObjectP
      * @return  The timeout in milliseconds that will be used while waiting for
      *          the Evictor to shut down.
      */
-    public long getEvictorShutdownTimeoutMillis() {
+    public final long getEvictorShutdownTimeoutMillis() {
         return evictorShutdownTimeoutMillis;
     }
 
@@ -656,7 +656,7 @@ public abstract class BaseGenericObjectP
      *                                      will be used while waiting for the
      *                                      Evictor to shut down.
      */
-    public void setEvictorShutdownTimeoutMillis(
+    public final void setEvictorShutdownTimeoutMillis(
             final long evictorShutdownTimeoutMillis) {
         this.evictorShutdownTimeoutMillis = evictorShutdownTimeoutMillis;
     }
@@ -720,7 +720,7 @@ public abstract class BaseGenericObjectP
     final void startEvictor(final long delay) {
         synchronized (evictionLock) {
             if (null != evictor) {
-                EvictionTimer.cancel(evictor, 10, TimeUnit.SECONDS);
+                EvictionTimer.cancel(evictor, evictorShutdownTimeoutMillis, TimeUnit.SECONDS);
                 evictor = null;
                 evictionIterator = null;
             }



Mime
View raw message