You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/05/03 13:27:40 UTC

(commons-pool) branch master updated (7b95533a -> 5d41a518)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git


    from 7b95533a Javadoc: Fix spelling
     new efbfd043 Improve readability
     new bfe3090c Fix spelling and action type
     new 930f165c Make org.apache.commons.pool3.impl.ResilientPooledObjectFactory.Adder thread-safe
     new 5d41a518 Javadoc

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                                           | 5 +++--
 src/main/java/org/apache/commons/pool3/PoolUtils.java             | 2 +-
 .../apache/commons/pool3/impl/ResilientPooledObjectFactory.java   | 8 ++++----
 .../org/apache/commons/pool3/impl/SoftReferenceObjectPool.java    | 2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)


(commons-pool) 01/04: Improve readability

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit efbfd043a4f58f77f749796557e73e63db27d6df
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat May 3 08:53:43 2025 -0400

    Improve readability
---
 src/main/java/org/apache/commons/pool3/PoolUtils.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/pool3/PoolUtils.java b/src/main/java/org/apache/commons/pool3/PoolUtils.java
index 430bd71c..795f2878 100644
--- a/src/main/java/org/apache/commons/pool3/PoolUtils.java
+++ b/src/main/java/org/apache/commons/pool3/PoolUtils.java
@@ -72,7 +72,7 @@ public final class PoolUtils {
          */
         ErodingFactor(final float factor) {
             this.factor = factor;
-            nextShrinkMillis = System.currentTimeMillis() + (long) (900000 * factor); // now + 15 min * factor
+            nextShrinkMillis = System.currentTimeMillis() + (long) (90_0000 * factor); // now + 15 min * factor
         }
 
         /**


(commons-pool) 02/04: Fix spelling and action type

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit bfe3090cd856b57f7da9a2e0809a6985a8a893fd
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat May 3 09:07:19 2025 -0400

    Fix spelling and action type
---
 src/changes/changes.xml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d381623b..61fe5bf8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -44,9 +44,10 @@ The <action> type attribute can be add,update,fix,remove.
     <title>Apache Commons Pool Release Notes</title>
   </properties>
   <body>
-  <release version="3.0.0" date="2023-MM-DD" description="This is a feature and maintenance release (Java 8 or above).">
+  <release version="3.0.0" date="YYYY-MM-DD" description="This is a feature and maintenance release (Java 8 or above).">
+    <!-- ADD -->
+    <action type="add" dev="psteitz" issue="POOL-407">Add ReslientPooledObjectFactory to provide resilience against factory outages.</action>
     <!-- FIX -->
-    <action type="fix" dev="psteitz" issue="POOL-407">Add ReslientPooledObjectFactory to provide resilence against factory outages.</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80).</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Operation on the "idleHighWaterMark" shared variable in "ErodingFactor" class is not atomic [org.apache.commons.pool3.PoolUtils$ErodingFactor] At PoolUtils.java:[line 101] AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE.</action>
     <!-- REMOVE -->


(commons-pool) 04/04: Javadoc

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit 5d41a5185a301e3d135a0b611e5cbc283a367654
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat May 3 09:20:55 2025 -0400

    Javadoc
---
 .../java/org/apache/commons/pool3/impl/SoftReferenceObjectPool.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/pool3/impl/SoftReferenceObjectPool.java b/src/main/java/org/apache/commons/pool3/impl/SoftReferenceObjectPool.java
index c5cd39a4..1a9bfa3b 100644
--- a/src/main/java/org/apache/commons/pool3/impl/SoftReferenceObjectPool.java
+++ b/src/main/java/org/apache/commons/pool3/impl/SoftReferenceObjectPool.java
@@ -253,7 +253,7 @@ public class SoftReferenceObjectPool<T, E extends Exception> extends BaseObjectP
     }
 
     /**
-     * Destroys a {@code PooledSoftReference} and removes it from the idle and all
+     * Destroys a {@link PooledSoftReference} and removes it from the idle and all
      * references pools.
      *
      * @param toDestroy PooledSoftReference to destroy


(commons-pool) 03/04: Make org.apache.commons.pool3.impl.ResilientPooledObjectFactory.Adder thread-safe

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit 930f165c4626edc4f5bdec690fdd10cd85158be9
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat May 3 09:17:55 2025 -0400

    Make org.apache.commons.pool3.impl.ResilientPooledObjectFactory.Adder
    thread-safe
---
 .../apache/commons/pool3/impl/ResilientPooledObjectFactory.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/pool3/impl/ResilientPooledObjectFactory.java b/src/main/java/org/apache/commons/pool3/impl/ResilientPooledObjectFactory.java
index d7739544..a6db26c8 100644
--- a/src/main/java/org/apache/commons/pool3/impl/ResilientPooledObjectFactory.java
+++ b/src/main/java/org/apache/commons/pool3/impl/ResilientPooledObjectFactory.java
@@ -57,8 +57,8 @@ public class ResilientPooledObjectFactory<T, E extends Exception> implements Poo
 
         private static final int MAX_FAILURES = 5;
 
-        private boolean killed;
-        private boolean running;
+        private volatile boolean killed;
+        private volatile boolean running;
         private int failures;
 
         public boolean isRunning() {
@@ -88,11 +88,11 @@ public class ResilientPooledObjectFactory<T, E extends Exception> implements Poo
                     try {
                         sleep(delay.toMillis());
                     } catch (final InterruptedException e) {
-                        killed = true;
+                        kill();
                     }
                 }
             }
-            killed = true;
+            kill();
             running = false;
         }
     }