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] Lock not released correctly #509

Closed
3 tasks done
tianping526 opened this issue May 10, 2023 · 0 comments · Fixed by #510
Closed
3 tasks done

[Bug] Lock not released correctly #509

tianping526 opened this issue May 10, 2023 · 0 comments · Fixed by #510
Labels
type/bug Something isn't working

Comments

@tianping526
Copy link

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.

Programming Language of the Client

Go

Runtime Platform Environment

5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

RocketMQ Version of the Client/Server

github.com/apache/rocketmq-clients/golang/v5 v5.0.1-rc.3

Run or Compiler Version

No response

Describe the Bug

rocketmq-clients/golang/[email protected]/rpc_client.go

func (rc *rpcClient) GracefulStop() error {
	rc.mux.Lock()
	sugarBaseLogger.Warnf("close rpc client, target=%s", rc.target)
	closeResult := rc.conn.Close()
	rc.mux.Lock()
	return closeResult
}

the GracefulStop method did not release the lock correctly

Steps to Reproduce

calling GracefulStop method in parallel, the second concurrent process will block permanently

What Did You Expect to See?

Lock is released correctly

What Did You See Instead?

Lock not released correctly

Additional Context

No response

@tianping526 tianping526 added the type/bug Something isn't working label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant