playframework icon indicating copy to clipboard operation
playframework copied to clipboard

Fix #8184 Evolutions Fail With a Small Pool

Open reardonj opened this issue 2 years ago • 0 comments

Fixes #8184

Check evolution state before acquiring the connection to actually perform the evolution operation. Previously, the connection to perform the actual operation was acquired before checking, requiring 2 simultaneous connections. This approach requires only a single connection.

Alternatively, checkEvolutionsState could be modified to take a current connection, but this would require more code changes to make sure autocommit is handled, and not all callsites have an open connection to use. Practically, Hikari will just reuse the same connection for both, so calling getConnection twice should not be expensive.

I modified the test suite to default to a single connection to make sure this was tested. Unfortunately, this required tweaking many checks, as the test suite itself opened a connection without closing it, causing a deadlock from the test code.

reardonj avatar Feb 19 '24 01:02 reardonj