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

Occasionally get connection timeout exception occur in HTTP requests #4188

Closed
GlowingRuby opened this issue Sep 22, 2021 · 3 comments · Fixed by #4191
Closed

Occasionally get connection timeout exception occur in HTTP requests #4188

GlowingRuby opened this issue Sep 22, 2021 · 3 comments · Fixed by #4191
Assignees
Labels
bug Something isn't working

Comments

@GlowingRuby
Copy link

Describe the bug

Deadlocks were found through thread dump, and the thread stacks were

image
image

In sharding-jdbc-1.5.4.1, called com.dangdang.ddframe.rdb.sharding.jdbc.core.connection.ShardingConnection#getMetaData, If there is no cached connection(because of druid connection pool logic), the metadata is obtained after the connection is created. Then the mysql driver call com.mysql.jdbc.ConnectionImpl#loadServerVariables When creating a connection to execute SQL, Triggered the io.opentelemetry.instrumentation.jdbc.internal.JdbcUtils#extractDbInfo method, but the lock has already been acquired by the thread executing the HTTP request, and the thread executing the HTTP request is waiting for the connection to be created, A deadlock has been created.

What version are you using?
v1.4.1

@GlowingRuby GlowingRuby added the bug Something isn't working label Sep 22, 2021
@trask trask self-assigned this Sep 23, 2021
@trask
Copy link
Member

trask commented Sep 23, 2021

@GlowingRuby thanks for reporting this!! I've sent a PR to address it #4191

@GlowingRuby
Copy link
Author

@GlowingRuby thanks for reporting this!! I've sent a PR to address it #4191

You're welcome~
Do we need to consider whether deadlock can also occur with other uses of WeakLockFreeCache?

@trask
Copy link
Member

trask commented Sep 23, 2021

Do we need to consider whether deadlock can also occur with other uses of WeakLockFreeCache?

that's an excellent question, I've opened #4192 to track and get others' feedback. I did do a cursory review of other calls to computeIfAbsent() and didn't see any other glaring callbacks to application code, but it's definitely worth a more detailed review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants