ruanwenjun commented on code in PR #15094:
URL: 
https://github.com/apache/dolphinscheduler/pull/15094#discussion_r1376314505


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java:
##########
@@ -120,6 +120,8 @@ public class DataSourceConstants {
 
     public static final String SPRING_DATASOURCE_TEST_ON_BORROW = 
"spring.datasource.testOnBorrow";
 
+    public static final String SPRING_DATASOURCE_IDLE_TIMEOUT = 
"spring.datasource.idleTimeoutMs";

Review Comment:
   Please add doc about how to using this configuration.



##########
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/provider/JDBCDataSourceProvider.java:
##########
@@ -56,9 +56,10 @@ public static HikariDataSource 
createOneSessionJdbcDataSource(BaseConnectionPara
 
         Boolean isOneSession = 
PropertyUtils.getBoolean(Constants.SUPPORT_HIVE_ONE_SESSION, false);
         dataSource.setMinimumIdle(
-                isOneSession ? 1 : 
PropertyUtils.getInt(DataSourceConstants.SPRING_DATASOURCE_MIN_IDLE, 5));
+                isOneSession ? 1 : 
PropertyUtils.getInt(DataSourceConstants.SPRING_DATASOURCE_MIN_IDLE, 0));
         dataSource.setMaximumPoolSize(
                 isOneSession ? 1 : 
PropertyUtils.getInt(DataSourceConstants.SPRING_DATASOURCE_MAX_ACTIVE, 50));
+        
dataSource.setIdleTimeout(PropertyUtils.getInt(DataSourceConstants.SPRING_DATASOURCE_IDLE_TIMEOUT,
 30000));

Review Comment:
   Using the Hikari's default value is better.



-- 
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]

Reply via email to