refactor: use ReentrantLock in PoolableConnection.close (#DBCP-591) - #322
Conversation
|
Hey @garydgregory any thoughts? |
Hello @cortlepp-intershop |
|
True, but do you have a suggestion on how to write such a test? Since the Issue is not that something doesn't work, it's rather a performance thing. The current implementation, because it uses In the discussion on the linked issue Phil Steitz also suggested that locking on this method might not be necessary at all, but since he wasn't sure I implemented the "safe" version using the alternative locking mechanism. In order to test that this works, my only idea would be to start the test runner with the JVM property |
|
Hello @psteitz and all, |
|
Hey @garydgregory @psteitz, just checking in: did you have a chance to think about this some more and how we could proceed here? |
|
Sorry for the very slow response. I think this is good to merge. I agree tests would be nice, but like the OP, I can't think of a simple way to demonstrate the impact of the pinning, which is pretty certain to happen on the (not normal) execution paths where connections get physically closed. This should have no impact on performance in earlier JDKs. I also verified that no other code relies on this object's monitor. |
|
The build is broken. |
|
Crap. Forgot to check checkstyle output. Seems a formatting nit. Will
fix in a few hours.
…On Thu, Jan 18, 2024 at 3:56 PM Gary Gregory ***@***.***> wrote:
The build is broken.
—
Reply to this email directly, view it on GitHub
<#322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALJJ2TTV353K3TOV6W4AGLYPGSCNAVCNFSM6AAAAAA7KWNOPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGM2TAMBXHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This PR removes synchronized from
PoolableConnection.close()and replaces it by aReentrantLockwhich is owned by the connection. I could not find any references in the code which externally synchronize on this connection, so I think that not other changes are necessary.This closes #DBCP-591.