-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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] Multiple deadlocks were detected during the client shutdown process. #8366
Closed
3 tasks done
Comments
YanYunyang
added a commit
to YanYunyang/rocketmq
that referenced
this issue
Jul 5, 2024
…er for a channel, no longer acquire a read lock.
YanYunyang
added a commit
to YanYunyang/rocketmq
that referenced
this issue
Jul 11, 2024
RongtongJin
pushed a commit
that referenced
this issue
Jul 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before Creating the Bug Report
I found a bug, not just asking a question, which should be created in GitHub Discussions.
I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
4.19.90-23-42.v2101.ky10.x86_64
RocketMQ version
5.2.0
JDK Version
openjdk 1.8
Describe the Bug
During the client shutdown process, deadlocks were detected, which resolved after a period of time.
This phenomenon was observed using jvisualvm and jconsole.
The deadlock occurred between the client shutdown thread and the Netty worker threads.
Code analysis:
NettyRemotingClient
holds thelockChannelTables
lock, which is responsible for guarding access tochannelTables
.channelTables
caches all channels encapsulated inChannelWrapper
.holds a read-write lock
lock`, responsible for concurrent access to the channel.NettyConnectManageHandler
inNettyRemotingClient
is responsible for handling events like close, connect, and channelInactive. When a channel becomes unavailable, it executes theclose
orchannelInactive
methods to remove the channel fromchannelTables
.Steps to Reproduce
1.Creating multiple consumer clients and shutting them down one by one. The more clients are created, the more likely a deadlock will be triggered.
2.Open jconsole and continuously click on deadlock detection.
What Did You Expect to See?
deadlocks were detected.
What Did You See Instead?
deadlocks were detected.
Additional Context
No response
The text was updated successfully, but these errors were encountered: