You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/09/30 22:59:55 UTC
DO NOT REPLY [Bug 13155] New: -
unexpected "exausted pool" error
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13155>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13155
unexpected "exausted pool" error
Summary: unexpected "exausted pool" error
Product: Commons
Version: Nightly Builds
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Dbcp
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: roytmana@peacetech.com
This is a repost of my bug submitted to Commons-Pool. I am not 100% positive
that it is Pool's problem and it affects DBCP users so I post it here too.
Please note that the problem only occure when using keyed pool
via getConnection(name, password).
I have been having "exausted pool" problems while using DBCP. In reality there
were zero objects in the pool and I should not have gotten this error.
While testing I found out that problem seems to be in GenericKeyedObjectPool:
while total number of connections _totalActive is perfectly balanced by calls
to borrowObject and returnObject (and actually is zero)
number of active objects per keyed pool (I have only one) _activeMap.get(key)
does not get decremented properly under certain conditions. as a result I have
_activeMap.get(key) greater then _totalActive.
I put some debug output in borrow and return methods
borrowObject() {
<snip>
} else {
Integer active = (Integer)(_activeMap.get(key));
if(null == active) {
_activeMap.put(key,new Integer(1));
} else {
_activeMap.put(key,new Integer(active.intValue() + 1));
}
System.out.println("BORROW: totalActive=" + _totalActive + ",
poolActive=" + active);
_totalActive++;
return pair.value;
}
}
}
returnObject() {
<snip>
System.out.println("RETURN: totalActive=" + _totalActive + ",
poolActive=" + active);
// if there's no space in the pool, flag the object
// for destruction
// else if we passivated succesfully, return it to the pool
if(_maxIdle > 0 && (pool.size() >= _maxIdle)) {
shouldDestroy = true;
} else if(success) {
pool.addFirst(new ObjectTimestampPair(obj));
_totalIdle++;
}
notifyAll();
}
if(shouldDestroy) {
try {
_factory.destroyObject(key, obj);
} catch(Exception e) {
// ignored?
}
}
}
and got following output:
BORROW: totalActive=0, poolActive=null
RETURN: totalActive=0, poolActive=1
BORROW: totalActive=0, poolActive=null
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=1
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=2
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=3
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=4
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=5
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=6
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=7
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=8
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=9
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=10
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=11
RETURN: totalActive=0, poolActive=null
BORROW: totalActive=0, poolActive=12
RETURN: totalActive=0, poolActive=null
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>