Skip to content

[pull] release from appsmithorg:release - #293

Merged
pull[bot] merged 1 commit into
code:releasefrom
appsmithorg:release
Jul 28, 2026
Merged

[pull] release from appsmithorg:release#293
pull[bot] merged 1 commit into
code:releasefrom
appsmithorg:release

Conversation

@pull

@pull pull Bot commented Jul 28, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

## Summary

Resolves
[APP-15267](https://linear.app/appsmith/issue/APP-15267/intermittent-pql-connector-timeouts).

A production pod recently hung for ~66 hours with every Postgres query
timing out at the 10s action timeout, recovering only on pod
replacement. Root cause: HikariCP's connection-adder thread blocks
indefinitely inside pgjdbc's auth read because `socketTimeout` defaults
to `0` (infinite). Since `addConnectionExecutor` is single-threaded, one
stuck creator wedges the entire pool — every subsequent borrow fails at
the action timeout because no replacement connection is ever produced.

Two complementary changes across 4 JDBC plugins (Postgres, MSSQL,
Oracle, Redshift):

- **Hikari `setKeepaliveTime(150_000)`** — `Connection.isValid()` probe
on idle connections every 150s, comfortably under AWS NAT's 350s
idle-eviction default. Prevents the most common trigger that forces the
pool to create new connections.
- **Driver-level socket read timeout** — bounds every socket read
including the auth-time read where the connection-adder was observed
hung. Default **600s (10 min)**, configurable via
`appsmith.plugin.jdbc.socket-timeout-seconds` (env
`APPSMITH_PLUGIN_JDBC_SOCKET_TIMEOUT_SECONDS`). 600s leaves plenty of
headroom for legitimately slow queries (default action timeout is 10s)
while ensuring the pool can always recover.

Driver-specific property mapping:

| Plugin | Property | Unit |
|---|---|---|
| Postgres / Redshift | `socketTimeout` | seconds |
| MSSQL | `socketTimeout` | milliseconds |
| Oracle | `oracle.net.READ_TIMEOUT` | milliseconds |
| Snowflake | keepalive only | (driver uses a different property
mechanism; full coverage deferred) |

Oracle and Redshift previously had no `ConnectionPoolConfig` injection;
constructor-injected here following the existing Postgres/MSSQL pattern.

## Reproduction and validation

Reproduced the wedge end-to-end with toxiproxy + iptables against a
local Appsmith v2.0 container. Thread dump confirmed the hang in
`HikariPool-N connection adder` at `doAuthentication.receiveChar`, with
byte-identical CPU time across snapshots ~7 minutes apart — definitive
proof the thread was parked indefinitely. With the fix, the pool
recovers automatically once the network path is restored.

## Test plan

- [x] Deploy preview comes up cleanly and Postgres datasources connect
normally
- [x] Verify default 600s applies when
`APPSMITH_PLUGIN_JDBC_SOCKET_TIMEOUT_SECONDS` is unset
- [x] Verify env-var override is honored (set to a different value,
observe behavior)
- [x] Confirm a normal Postgres query under 600s server-side latency
executes successfully
- [x] (Manual repro) Simulate connection-adder wedge via toxiproxy +
iptables; confirm pool recovers within ~600s instead of hanging
indefinitely

## Follow-ups (not in this PR)

- Snowflake `networkTimeout` plumbing (its driver uses a different
property mechanism that lives in upstream Properties)
- Consider per-query `Connection.setNetworkTimeout(actionTimeout +
buffer)` in `executeCommon` for more precise per-query bounding (defense
in depth)
- Production observability: periodic Hikari pool-stats logging (not just
on successful query) so the next recurrence — if any — surfaces faster

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Configurable socket timeout for database connections with a 600-second
default, exposed via configuration.

* **Improvements**
* Connection pools across multiple database plugins now respect the
configured socket timeout and enable TCP keepalive probes to reduce idle
connection drops.

* **Tests**
* Updated tests to provide and validate the new socket timeout and
pool-size parameters.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/appsmithorg/appsmith/pull/41851?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/30005563482>
> Commit: 2f8c168
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=30005563482&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 23 Jul 2026 13:17:24 UTC
<!-- end of auto-generated comment: Cypress test results  -->



## Automation
/ok-to-test tags="@tag.All"

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Jul 28, 2026
@pull pull Bot added the ⤵️ pull label Jul 28, 2026
@pull
pull Bot merged commit 3bf3f67 into code:release Jul 28, 2026
2 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant