[ https://issues.apache.org/jira/browse/BEAM-7230?focusedWorklogId=335758&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-335758 ]
ASF GitHub Bot logged work on BEAM-7230: ---------------------------------------- Author: ASF GitHub Bot Created on: 29/Oct/19 21:14 Start Date: 29/Oct/19 21:14 Worklog Time Spent: 10m Work Description: lukecwik commented on pull request #9904: [BEAM-7230] Fixes NPE When Using JdbcIO.PoolableDataSourceProvider URL: https://github.com/apache/beam/pull/9904#discussion_r340327405 ########## File path: sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java ########## @@ -1395,7 +1395,7 @@ public DataSource apply(Void input) { static synchronized DataSource buildDataSource(Void input) { if (source == null) { - DataSource basicSource = dataSourceProviderFn.apply(input); + DataSource basicSource = dataSourceProviderFn.apply(null); Review comment: The issue is that PoolableDataSourceProvider stores dataSourceProviderFn as a static which means that it will never be serialized and is lost when ever executed within a runner remotely. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 335758) Time Spent: 3h (was: 2h 50m) > Using JdbcIO creates huge amount of connections > ----------------------------------------------- > > Key: BEAM-7230 > URL: https://issues.apache.org/jira/browse/BEAM-7230 > Project: Beam > Issue Type: Bug > Components: runner-dataflow > Affects Versions: 2.11.0 > Reporter: Brachi Packter > Assignee: Ismaël Mejía > Priority: Major > Fix For: 2.13.0 > > Time Spent: 3h > Remaining Estimate: 0h > > I want to write form DataFlow to GCP cloud SQL, I'm using connection pool, > and still I see huge amount of connections in GCP SQL (4k while I set > connection pool to 300), and most of them in sleep. -- This message was sent by Atlassian Jira (v8.3.4#803005)