This is an automated email from the ASF dual-hosted git repository.

wlo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/gobblin.git


The following commit(s) were added to refs/heads/master by this push:
     new 250279e01 Log current stacktrace on every 
`MysqlStateStore.newDataSource` invocation, to help catch possible resource 
leak (#3644)
250279e01 is described below

commit 250279e01e9d649e943c706cbf4fd3597cc28745
Author: Kip Kohn <[email protected]>
AuthorDate: Tue Feb 14 09:28:27 2023 -0800

    Log current stacktrace on every `MysqlStateStore.newDataSource` invocation, 
to help catch possible resource leak (#3644)
---
 .../src/main/java/org/apache/gobblin/metastore/MysqlStateStore.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/gobblin-metastore/src/main/java/org/apache/gobblin/metastore/MysqlStateStore.java
 
b/gobblin-metastore/src/main/java/org/apache/gobblin/metastore/MysqlStateStore.java
index 85d5cbc5b..956a42b83 100644
--- 
a/gobblin-metastore/src/main/java/org/apache/gobblin/metastore/MysqlStateStore.java
+++ 
b/gobblin-metastore/src/main/java/org/apache/gobblin/metastore/MysqlStateStore.java
@@ -35,6 +35,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Timestamp;
 import java.time.Duration;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -214,6 +215,9 @@ public class MysqlStateStore<T extends State> implements 
StateStore<T> {
     } catch (URISyntaxException e) {
       LOG.warn("unable to parse JDBC URL '{}' - {}", jdbcUrl, e.getMessage());
     }
+    // TODO: consider whether to demote to DEBUG log level
+    LOG.info("creating pool '{}' for caller with stacktrace: {}", poolName,
+        Arrays.toString(Thread.currentThread().getStackTrace()).replace(", ", 
"\n  at "));
     dataSource.setPoolName(poolName);
     dataSource.setDriverClassName(ConfigUtils.getString(config, 
ConfigurationKeys.STATE_STORE_DB_JDBC_DRIVER_KEY,
         ConfigurationKeys.DEFAULT_STATE_STORE_DB_JDBC_DRIVER));

Reply via email to