The GitHub Actions job "Required Checks" on texera.git/main has failed.
Run started by GitHub user aicam (triggered by aicam).

Head commit for run:
078ab64d3e03cf28509c9c8e05fda558a0bcf159 / Matthew B. <[email protected]>
feat: Adding a connection pool to reduce the time spent opening connection to 
Postgres (#4851)

<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to
Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
  2. Ensure you have added or run the appropriate tests for your PR
  3. If the PR is work in progress, mark it a draft on GitHub.
  4. Please write your PR title to summarize what this PR proposes, we 
    are following Conventional Commits style for PR titles as well.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this
section
is to outline the changes. Here are some tips for you:
  1. If you propose a new API, clarify the use case for a new API.
  2. If you fix a bug, you can clarify why it is a bug.
  3. If it is a refactoring, clarify what has been changed.
  3. It would be helpful to include a before-and-after comparison using 
     screenshots or GIFs.
  4. Please consider writing useful notes for better and faster reviews.
-->
This PR adds a HikariCP connection pool to SqlServer.scala so that jOOQ
queries borrow pre-authenticated connections from a pool instead of
opening a new TCP connection and performing SCRAM-SHA-256 authentication
on every database call.
### What changed in SqlServer.scala:
- Added a HikariConfig with maximumPoolSize=10, minimumIdle=2,
connectionTimeout=30s, idleTimeout=10min, maxLifetime=30min (chosen to
stay below typical PostgreSQL idle and load-balancer connection-reaping
windows)
- Initialized a HikariDataSource and built the jOOQ DSLContext via
DSL.using(dataSource, SQL_DIALECT) so queries draw from the pool
- Added a close() method to shut down the pool on application or test
teardown, and updated clearInstance() to call it, so test classes that
replace the singleton don't leak pool threads
- Added a documented warning against caching the DSLContext in a val or
lazy val. MockTexeraDB swaps the singleton between test classes, and a
cached context would hold a stale reference to a dead pool

### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned
already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
#1234`
or `Closes #1234`. If it is only related, simply mention the issue
number.
  2. If there is design documentation, please add the link.
  3. If there is a discussion in the mailing list, please add the link.
-->
closes: #4852 

### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if
the PR
is tested with existing test cases. Make sure to include/update test
cases that
check the changes thoroughly including negative and positive cases if
possible.
If it was tested in a way different from regular unit tests, please
clarify how
you tested step by step, ideally copy and paste-able, so that other
reviewers can
test and check, and descendants can verify in the future. If tests were
not added,
please describe why they were not added and/or why it was difficult to
add.
-->
- Existing unit and integration tests pass — the pool-backed DSLContext
is a drop-in replacement for the previous direct-driver context
- Verified the MockTexeraDB flow still works across test classes by
running the full test suite and confirming no "Connection refused"
failures from stale contexts

### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
PR,
please include the phrase: 'Generated-by: ' followed by the name of the
tool
and its version. If no, write 'No'. 
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for
details.
-->
Co-authored with Claude opus 4.6 (Anthropic) in compliance with ASF

---------

Co-authored-by: Yicong Huang <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/25758482747

With regards,
GitHub Actions via GitBox

Reply via email to