Skip to content

Conversation

@rPraml
Copy link
Collaborator

@rPraml rPraml commented Feb 27, 2025

There is an issue, if there is high load on the pool.

in the obtainConnection there is code, that prefers "waitingThreads" with the next connection, that comes back in the pool.
what can happen now:

  • if the connection pool is near the limit (here we use maxSize=1) and we hold the connection, while the heartbeat runs, the heartbeat might reset the pool.
  • waiting threads are preferred to get the next connection, that is returned to the pool in _obtainConnectionWaitLoop
  • but there is no connection, that will get back to the loop (pool was reseted)

I've simplified the test, it might be, that this test is flaky now, but it better demonstrates the issue.

Without this fix, we have one successful execution (see first commit), after the fix, all executions are successful.

rPraml added a commit to FOCONIS/ebean-datasource that referenced this pull request Feb 27, 2025
@rbygrave rbygrave added this to the 9.3 milestone Feb 27, 2025
@rbygrave rbygrave merged commit 7627589 into ebean-orm:master Feb 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants