-
Notifications
You must be signed in to change notification settings - Fork 195
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
connectionReleaseDelay PoolOption #710
base: master
Are you sure you want to change the base?
connectionReleaseDelay PoolOption #710
Conversation
Close idle connections that wait in the pool for connectionReleaseDelay milliseconds. Defaults to 0 = keep them forever. The option name is taken from vertx-mysql-postgresql-client: https://github.com/vert-x3/vertx-mysql-postgresql-client/blob/3.9.1/vertx-mysql-postgresql-client-jasync/src/main/java/io/vertx/ext/asyncsql/impl/pool/AsyncC$ Implementation If connectionReleaseDelay is > 0: When a connection is put into the pool create a timer that closes the connection and removes it from the pool: expire(). If a connection in the pool is acquired before the timer fires the timer is cancelled: cancelIdleTimer(). In PoolOptions * add connectionReleaseDelay option * fix and unit test equals() and hashCode() In ConnectionPool * add constructor that takes PoolOptions to avoid long parameter lists * add package-private allSize() for unit testing * rename and move release(PooledConnection) to PooledConnection.addToPool() to avoid a name that is misleading if connectionReleaseDelay exists Signed-off-by: Julian Ladisch <eclipse.org-rtn@ladisch.de>
the pool should be reimplemented before 4.0 or around, so I would rather do that in the new pool rather than adding this here |
We use and will use the old pool in production and therefore would like to have this merged upstream (= in eclipse-vertx/vertx-sql-client) to avoid maintaining a fork. |
@vietj Is the code quality of this pull request too low, or is the scheduled pool re-implementation the only reason? |
@vietj What needs to be changed to get this merged to eclipse-vertx/vertx-sql-client? |
at least |
it is rescheduled reimplementation based on the vertx HTTP pool but that would be in 4.1 or 4.2 |
Close idle connections that wait in the pool for connectionReleaseDelay
milliseconds. Defaults to 0 = keep them forever.
The option name is taken from vertx-mysql-postgresql-client:
https://github.com/vert-x3/vertx-mysql-postgresql-client/blob/3.9.1/vertx-mysql-postgresql-client-jasync/src/main/java/io/vertx/ext/asyncsql/impl/pool/AsyncConnectionPool.java#L68
Implementation
If connectionReleaseDelay is > 0:
When a connection is put into the pool create a timer
that closes the connection and removes it from the pool: expire().
If a connection in the pool is acquired before the timer
fires the timer is cancelled: cancelIdleTimer().
In PoolOptions
In ConnectionPool
to avoid a name that is misleading if connectionReleaseDelay exists