terrymanu commented on issue #37845:
URL:
https://github.com/apache/shardingsphere/issues/37845#issuecomment-3804497398
Understood the latest info and attachments; it still points to a
connection-layer timeout when the master enables Druid PSCache, not a confirmed
ShardingSphere bug.
Issue Understanding
- ShardingSphere-JDBC 5.5.1; Oracle master oracle and slave oracle-read;
Druid 1.2.20; Oracle JDBC 19.3.
- Only when the master sets pool-prepared-statements=true and
max-pool-prepared-statement-per-connection-size=20, the
@Bean("ShardingSphereDataSource") startup fails. Removing PSCache or not
creating that bean starts OK.
- Error root: java.sql.SQLRecoverableException: IO error: Socket read
timed out during ShardingSphereDataSource creation.
Root Cause
- No evidence yet of a ShardingSphere logic bug. The failure occurs while
acquiring a master connection; the timeout is thrown by the Oracle
driver/Druid. ShardingSphere simply triggers an early connection for metadata
loading.
- metadata-loading-enabled is not a recognized ShardingSphere property, so
metadata loading still runs; that forces an early master connection and exposes
the timeout.
Analysis
- ShardingSphereDataSourceFactory reuses provided DataSources; it does not
alter Druid PSCache behavior. The stack points to driver-level socket timeout
on first connection when PSCache is enabled on the master.
- Slave with the same PSCache config works; the issue is specific to the
master path/network/db settings rather than ShardingSphere routing logic.
- Using the raw master DataSource as default can start because
ShardingSphere’s metadata load is skipped, so the problematic early connection
isn’t triggered.
- Missing data prevents pinpointing whether the timeout is from validation
query, PSCache init, or network latency.
Conclusion / Info Needed
- Cannot conclude a ShardingSphere defect; likely a master-side
connectivity/driver timeout surfaced by ShardingSphere’s startup connection.
Please provide:
1. Full startup log/stack when master PSCache is enabled and
@Bean("ShardingSphereDataSource") is used—especially the first
SQLRecoverableException stack.
2. Result and timing of creating the master DruidDataSource and
calling getConnection().close() directly (without ShardingSphere) with PSCache
on.
3. Any Druid/Oracle driver debug logs around the timeout.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]