alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.96k stars 8.58k forks source link

[BUG] druid init method run slow : line895 this.createPhysicalConnection() #6187

Open lucky-lbc opened 2 weeks ago

lucky-lbc commented 2 weeks ago

Database Type

mysql

Database Version

mysql8.0.31

Druid Version

1.2.23

JDK Version

jdk17

Error SQL

no sql just spring boot init . and run in druid init() method. was slow

Testcase Code

No response

Stacktrace Info

No response

Error Info

druid init method was slow. debug this in line 895 method: this.createPhysicalConnection(); 图片 and in this method: 图片 when line 1727: var29 = true; is slowly

i want to know why ?. and how to handle it

lucky-lbc commented 2 weeks ago

spring boot version 3.2.x

lucky-lbc commented 2 weeks ago

It may be a decompilation issue。debug var29 can step into . 图片 i think that is slow line : Connection rawConn = this.getDriver().connect(url, info);

lucky-lbc commented 2 weeks ago

finally i found this slowly code : class: ConnectionImpl . package com.mysql.cj.jdbc; inetSocketAddress.getHostName() It may be a DNS resolution issue。 but no idea to deal it ...