You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2011/01/05 03:16:46 UTC
[jira] Created: (POOL-180) Max active per key can be exceeded by
one
Max active per key can be exceeded by one
-----------------------------------------
Key: POOL-180
URL: https://issues.apache.org/jira/browse/POOL-180
Project: Commons Pool
Issue Type: Bug
Affects Versions: 1.5.4, 1.5.5, 1.5.3, 1.5.2, 1.5.1, 1.5
Reporter: Phil Steitz
Priority: Minor
Fix For: 1.5.6
When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] [Resolved] (POOL-180) Max active per key can be exceeded by
one
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas resolved POOL-180.
------------------------------
Resolution: Fixed
The additional issues have been fixed in trunk and 1.5.x
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Assignee: Mark Thomas
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (POOL-180) Max active per key can be exceeded by
one
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010214#comment-13010214 ]
Phil Steitz commented on POOL-180:
----------------------------------
I have also been working on a fix for this. It gets a little messy because clear() and clearOldest() both need to have their accounting fixed and you need to postpone removing depleted pools from _poolMap until after destroy completes so you can continue to track internal processing count for the depleted pool. One other thing I noticed is that clear does not seem to clear _poolMap.
Sorry the test case was messed up.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (POOL-180) Max active per key can be exceeded by
one
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz closed POOL-180.
----------------------------
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Assignee: Mark Thomas
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (POOL-180) Max active per key can be exceeded by
one
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas resolved POOL-180.
------------------------------
Resolution: Fixed
Assignee: Mark Thomas
Fixed in 1.5.x and trunk. There was actually a bigger issue in that the tracking information was being thrown away too soon. Fixing that and the issue Phil noticed, allowed the test case to complete.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Assignee: Mark Thomas
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (POOL-180) Max active per key can be exceeded by
one
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010181#comment-13010181 ]
Mark Thomas commented on POOL-180:
----------------------------------
Now I am seeing failures. The test appears to be timing sensitive. Not entirely surprising. Still working on a fix.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (POOL-180) Max active per key can be exceeded by
one
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas reopened POOL-180:
------------------------------
Phil spotted similar issues in evict that also need to be fixed.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Assignee: Mark Thomas
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (POOL-180) Max active per key can be exceeded by
one
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz updated POOL-180:
-----------------------------
Attachment: maxAcitivePerKeyExceededTest.patch
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (POOL-180) Max active per key can be exceeded by
one
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977619#action_12977619 ]
Phil Steitz commented on POOL-180:
----------------------------------
I think the problem is in clearOldest/destroy where only _totalInternalProcessing is incremented/decremented. The individual key processing counts need to be updated as well. When clearOldest is disabled, the test succeeds.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] [Commented] (POOL-180) Max active per key can be exceeded by
one
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010174#comment-13010174 ]
Mark Thomas commented on POOL-180:
----------------------------------
I think Phil's analysis is correct but the test fails due to a mis-match between WaiterFactory and the pool.
WaiterFactory#maxActive=5 <=> pool#maxTotal =8
WaiterFactory#maxActivePerKey=8 <=> pool#maxActive=5
There are four keys in the test. The pool could have 3 keys each with 2 objects for a total of 6 objects. 6 < 8 (pool#maxTotal) and 2 < 5 (pool#maxActive) so the pool is well within limits. However, 6 !< 5 hence the WaiterFactory throws an error.
With the mismatch corrected, I can't recreate the error but I will fix the issue Phil identified.
> Max active per key can be exceeded by one
> -----------------------------------------
>
> Key: POOL-180
> URL: https://issues.apache.org/jira/browse/POOL-180
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.5, 1.5.4
> Reporter: Phil Steitz
> Priority: Minor
> Fix For: 1.5.6
>
> Attachments: maxAcitivePerKeyExceededTest.patch
>
>
> When instances in the pool fail validation with high frequency, maxTotal is less than maxActive times the number of keys, and destroy has latency, the maxActive contract can be violated (i.e., the number of instances created under a given key minus the number destroyed can exceed maxActive).
> Attaching a test case that fails against POOL_1_X
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira