[
https://issues.apache.org/jira/browse/KNOX-3592?focusedWorklogId=1055689&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1055689
]
ASF GitHub Bot logged work on KNOX-3592:
----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Nov/26 14:05
Start Date: 18/Nov/26 14:05
Worklog Time Spent: 10m
Work Description: github-actions[bot] commented on PR #1526:
URL: https://github.com/apache/knox/pull/1526#issuecomment-6980897997
## Test Results
5 files 5 suites 1m 23s ⏱️
227 tests 226 ✅ 1 💤 0 ❌
271 runs 270 ✅ 1 💤 0 ❌
Results for commit 0f13cdc9.
[test-results]:data:application/gzip;base64,H4sIAK6w/WoC/03MSw6DIBSF4a0Yxh1wQR52M42FS0Kq0vAYme69lFh0+H8nOTtxfsFE7oO4DSQVn3vYEufsw1ZT89p1yb+NMfWvRyrGNJInvfy7EnRws18q0A4YY4iHxLK1TwVH9EtFu5yPrS+Hra9/JqyrzzUIdcCNNRMoNj4FIpUctNNMTKN1DEFaCUqjIZ8vdl2ymAQBAAA=
Issue Time Tracking
-------------------
Worklog Id: (was: 1055689)
Time Spent: 20m (was: 10m)
> Use a pooled JDBC DataSource for the gateway database
> -----------------------------------------------------
>
> Key: KNOX-3592
> URL: https://issues.apache.org/jira/browse/KNOX-3592
> Project: Apache Knox
> Issue Type: Improvement
> Components: KnoxIDF
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 3.1.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> None of the {{DataSourceFactory}} implementations pool connections:
> * Postgres uses {{PGSimpleDataSource}}.
> * MySQL and MariaDB use {{MysqlDataSource}}.
> * Oracle uses plain {{OracleDataSource}}.
> * H2 uses {{JdbcDataSource}}.
> As a result, every {{getConnection()}} opens a new TCP connection and logs in
> again (on Postgres that is SCRAM-SHA-256, plus a TLS handshake if SSL is
> enabled). {{DataSourceProvider}} also builds a separate DataSource for each
> service, e.g. token state, delegation policies, trusted OIDC issuers,
> federated identity and the remote config monitor.
> On hot paths this cost repeats on every request. For example, RFC 8693 token
> exchange does a delegation policy lookup per exchange, and
> {{JDBCTokenStateService}} runs two statements per metadata entry for each new
> token. Thread dumps under load show request threads blocked in connection
> setup and authentication. With remote databases the cost grows with network
> latency.
> *Proposal:*
> * Wrap the vendor DataSource in a connection pool, for example HikariCP
> (Apache-2.0).
> * Share one pooled DataSource across all DB-backed services.
> * Make the pool configurable in {{gateway-site.xml}}:
> {{gateway.database.pool.*}} for max size, min idle, connection timeout, idle
> timeout and max lifetime, with sensible defaults.
> * Close the pool on gateway shutdown.
> * Existing connection, credential-alias and SSL settings keep working
> unchanged.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)