Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug:socketTimeout参数不支持mysql jdbcurl里设置socketTimeout=0的场景 #5451

Closed
lizongbo opened this issue Sep 29, 2023 · 2 comments
Closed

Comments

@lizongbo
Copy link
Collaborator

参考:
#5419
https://dev.mysql.com/doc/connector-j/8.1/en/connector-j-connp-props-networking.html

mysql的jdbc url里,connectTimeout和socketTimeout,在不指定的情况下,默认是0表示永不超时,我们的项目中一直没设置这个值,可以配置的值范围是 0 - 2147483647

而druid现在的初始化过程中,在按url识别参数后,针对等于0的,强制设置成了默认值10秒。

image

导致即使想通过只修改jdbc url来实现继续保持永久超时,也是没办法做到了。

image

修复方式,把设置默认值的逻辑放到前面即可

image

lizongbo added a commit to lizongbo/druid that referenced this issue Sep 29, 2023
socketTimeout参数不支持mysql jdbcurl里设置socketTimeout=0的场景
wenshao pushed a commit that referenced this issue Sep 29, 2023
socketTimeout参数不支持mysql jdbcurl里设置socketTimeout=0的场景
@qq592304796
Copy link

qq592304796 commented Dec 20, 2023

@wenshao 现在升级之后(1.2.20),默认是10s,之前默认是0不超时,现在是必须要指定socketTimeout参数吗?

@lizongbo
Copy link
Collaborator Author

@wenshao 现在升级之后(1.2.20),默认是10s,之前默认是0不超时,现在是必须要指定socketTimeout参数吗?

目前的版本是这样,这个对从低版本升级上来的项目很不友好,我在纠结要不要把设置默认10s的逻辑去掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants