You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "SauronShepherd (via GitHub)" <gi...@apache.org> on 2025/02/20 05:41:00 UTC

[PR] [SPARK-51264][SQL][JDBC] JDBC write keeps driver connection open unnecessarily [spark]

SauronShepherd opened a new pull request, #50014:
URL: https://github.com/apache/spark/pull/50014

   ### What changes were proposed in this pull request?
   Close connection before `saveTable` calls in `org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider`. Check if the connection has been already closed before the last `close` in the `finally` block.
   
   ### Why are the changes needed?
   A JDBC connection was created in the `JdbcRelationProvider` class to truncate, drop, or create the table. However, this connection remained open and idle throughout the entire save process, which could take some time. This caused unnecessary resource consumption on both the Spark driver and the database. Additionally, the idle connection was at risk of being dropped by the database, firewall, or proxy. Best practices recommend releasing resources as soon as they are no longer needed.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Local tests + Spark unit tests
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-51264][SQL][JDBC] JDBC write keeps driver connection open unnecessarily [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #50014: [SPARK-51264][SQL][JDBC] JDBC write keeps driver connection open unnecessarily
URL: https://github.com/apache/spark/pull/50014


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-51264][SQL][JDBC] JDBC write keeps driver connection open unnecessarily [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50014:
URL: https://github.com/apache/spark/pull/50014#issuecomment-3040483636

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org