Copilot commented on code in PR #10734:
URL: https://github.com/apache/gravitino/pull/10734#discussion_r3063018882
##########
core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java:
##########
@@ -89,14 +89,14 @@ public void init(Config config) {
config.get(Configs.ENTITY_RELATIONAL_JDBC_BACKEND_WAIT_MILLISECONDS));
dataSource.setMaxTotal(config.get(Configs.ENTITY_RELATIONAL_JDBC_BACKEND_MAX_CONNECTIONS));
dataSource.setMaxIdle(5);
- dataSource.setMinIdle(0);
+ dataSource.setMinIdle(5);
dataSource.setLogAbandoned(true);
Review Comment:
The idle-size value `5` is now duplicated between `setMaxIdle(5)` and
`setMinIdle(5)`. Consider defining a single constant (or deriving one from the
other) to prevent future mismatches when tuning the pool.
##########
core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java:
##########
@@ -89,14 +89,14 @@ public void init(Config config) {
config.get(Configs.ENTITY_RELATIONAL_JDBC_BACKEND_WAIT_MILLISECONDS));
dataSource.setMaxTotal(config.get(Configs.ENTITY_RELATIONAL_JDBC_BACKEND_MAX_CONNECTIONS));
dataSource.setMaxIdle(5);
- dataSource.setMinIdle(0);
+ dataSource.setMinIdle(5);
dataSource.setLogAbandoned(true);
dataSource.setRemoveAbandonedOnBorrow(true);
dataSource.setRemoveAbandonedTimeout(60);
dataSource.setTimeBetweenEvictionRunsMillis(Duration.ofMillis(10 * 60 *
1000L).toMillis());
dataSource.setTestOnBorrow(true);
dataSource.setTestWhileIdle(true);
- dataSource.setMinEvictableIdleTimeMillis(1000);
+
dataSource.setMinEvictableIdleTimeMillis(Duration.ofSeconds(30).toMillis());
Review Comment:
The pool settings change (minIdle/minEvictableIdleTimeMillis) isn’t
currently covered by a unit assertion. Please add/extend a test (e.g., in
TestSqlSession#testInit) to verify the configured BasicDataSource values so
this behavior change is protected from regressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]