Fix regression in fix for POOL-425, fix race in POOL-426.#452
Fix regression in fix for POOL-425, fix race in POOL-426.#452garydgregory merged 1 commit intoPOOL_2_Xfrom
Conversation
|
@psteitz Could you also include the additional tests at https://github.com/apache/commons-pool/pull/451/changes as well ? There is an additional test for POOL-413 as well and I think this fixes POOL-413 as well. Thanks! |
|
I don't think #451 fixes POOL-413 as per my investigation. If you run all the tests, the tests seems to pass but if you run the test only in isolation, it will fail. Not sure what's going on there. @psteitz could you confirm this ? Happy Holidays to you awesome folks! |
|
When I add just the tests, they fail, as I expected they would. I did not make changes to create, which it looks like one of the PRs against master was trying to do. I don't think that change is correct. The patch in this PR does not make changes to create. |
|
But thanks for the tests. Please add a link or just paste them to POOL-413 JIRA as they do illustrate that issue. |
|
Yeah. That change is incorrect where we were taking the min value. I think the fix in this PR is correct for POOL-426. The fix is not correct for POOL-413. |
|
I am really sorry, guys, but I am going to have to revert this change. The added sync violates the "no factory methods while holding a lock" invariant, since it effectively extends the lock to all of create. I will revert the change and implement the simple fix for the regression. |
|
Addendum mentioned in previous comment for reference: 8f46cde |
Fixes the regression in the fix for POOL-425, which made addObject no-op when maxIdle is negative (no limit). Also fixes the race condition identified in POOL-426.