spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.23k stars 40.7k forks source link

It seems that driverDelegate is set to protocols in ConnectionFactoryBuilder.delegateFactoryOptions #41640

Closed wondevc closed 3 months ago

wondevc commented 3 months ago

Spring Boot Version : v3.3.2 RELEASE

Related PR : https://github.com/spring-projects/spring-boot/commit/eb1200415dee2b8e84bec3b9bedc55101d7653b7#diff-e8a2a8cb23de24e30e2577430ad4d43354da201e61d30de5d6653a4126b571a7R222

If this is a bug, I think it needs to be fixed as soon as possible My pooling settings are being ignored.

Additionally, I found that the connection factory is being created with copied options, which completely ignore my settings

original

ConnectionFactoryOptions{options={database=..., host=localhost, maxLifeTime=PT1H, minIdle=5, useUnicode=true, port=3308, serverTimezone=Asia/Seoul, user=root, maxIdleTime=PT10M, maxValidationTime=PT5M, maxSize=10, driver=pool, characterEncoding=utf8, password=REDACTED, initialSize=5, protocol=mysql, ssl=true, maxAcquireTime=PT30S, maxCreateConnectionTime=PT30S}}

copied

ConnectionFactoryOptions{options={database=..., host=localhost, maxLifeTime=PT1H, minIdle=5, useUnicode=true, port=3308, serverTimezone=Asia/Seoul, user=root, maxIdleTime=PT10M, maxValidationTime=PT5M, maxSize=10, driver=mysql, characterEncoding=utf8, password=REDACTED, initialSize=5, protocol=, ssl=true, maxAcquireTime=PT30S, maxCreateConnectionTime=PT30S}}
wilkinsona commented 3 months ago

If this is a bug, I think it needs to be fixed as soon as possible

Creating artificial urgency doesn't really help anyone.

If you would like something to be fixed as soon as possible, open a pull request that contributes a test that reproduces the problem you're facing and the necessary changes to make the test pass. Failing that, providing a minimal reproducible example will allow someone else to identify and, if necessary, fix the problem more quickly.

wondevc commented 3 months ago

Sorry for the delay in updating as I was checking more thoroughly.

I found that the PoolingAwareOptionsCapableWrapper is correctly creating the ConnectionPool, and the part where I saw driver options being overwritten was actually part of the logic for creating delegate connection factory options.

My mistake—there's no issue with this part!