commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: svn commit: r774576 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Date Thu, 14 May 2009 02:20:13 GMT
Can you explain - maybe in the JIRA - what the problem is here and how 
the change fixes it?  I see there is a problem, but I am missing 
something on the resolution.

Also, I think the first _numActive-- needs to be guarded by a 
decrementNumActive test, else when addObjectToPool is called by 
addObject, you will incorrectly decrement the active count.   The fact 
that no test failed after this change means either 1) I am missing 
something or 2) we are missing tests on how addObject works with _numActive.

Phil

markt@apache.org wrote:
> Author: markt
> Date: Wed May 13 22:44:48 2009
> New Revision: 774576
>
> URL: http://svn.apache.org/viewvc?rev=774576&view=rev
> Log:
> Fix POOL-135 for GOP.
>
> Modified:
>     commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
>
> Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
> URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java?rev=774576&r1=774575&r2=774576&view=diff
> ==============================================================================
> --- commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
(original)
> +++ commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
Wed May 13 22:44:48 2009
> @@ -1149,6 +1149,8 @@
>                      } else {
>                          _pool.addLast(new ObjectTimestampPair(obj));
>                      }
> +                    _numActive--;
> +                    notifyAll();
>                  }
>              }
>          }
> @@ -1160,15 +1162,15 @@
>              } catch(Exception e) {
>                  // ignored
>              }
> -        }
> -        
> -        // Decrement active count *after* destroy if applicable
> -        if (decrementNumActive) {
> -            synchronized(this) {
> -                _numActive--;
> -                notifyAll();
> +            // Decrement active count *after* destroy if applicable
> +            if (decrementNumActive) {
> +                synchronized(this) {
> +                    _numActive--;
> +                    notifyAll();
> +                }
>              }
>          }
> +        
>      }
>  
>      public void close() throws Exception {
>
>
>   


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


Mime
View raw message