-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition: connection pool maximum can be exceeded #7
Comments
I will fix this. |
From what I can tell, sqljocky5 v2.2.0 (unfortunately) no longer supports connection pooling. |
Pooling is moved to https://pub.dartlang.org/packages/conn_pool |
The sqljocky5 documentation doesn't mention it anywhere. Also, the README for conn_pool only talks about PostgreSQL: how does it work with MySQL/MariaDB and sqljocky5? Need some more documentation on how it is used. |
It is a database agnostic connection pool. One has to implement |
There is a postgres example here: https://github.com/Jaguar-dart/db/blob/master/postgres/lib/src/manager.dart#L7 |
An exercise for the reader :-) |
More connections than the maximum number for the pool can be created, if too many connections are requested all at once at the start.
The "start" being when the connections are first being established, or are being re-established after they have timed out.
The cause seems to be the Future returned by the call to
_createConnection
(in line 97 of connection_pool_impl.dart) is not being waited upon. If the application program keeps asking for connections/transactions without yielding, the new connections don't get added to the_pool
list (line 109) and therefore the test to see if the maximum number of connections has already been created (line 95) incorrectly allows more connections to be created.Program that demonstrates the race condition: pool-filling-test.txt
The text was updated successfully, but these errors were encountered: