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

Fix cc.Close() state race #440

Merged
merged 1 commit into from
Nov 18, 2015
Merged

Fix cc.Close() state race #440

merged 1 commit into from
Nov 18, 2015

Conversation

dkwasnick
Copy link
Contributor

Fix a race condition in which a Conn's state is set to TransientFailure after Close() has been invoked – Close() should irrevocably set state to Shutdown.

Fix a race condition in which a Conn's state is set to TransientFailure after Close() has been invoked – Close() should irrevocably set state to Shutdown.
@dkwasnick
Copy link
Contributor Author

This race condition manifests itself when you have multiple goroutines accessing the same ClientConn, and one of them attempts to manually close the connection. The second goroutine can set cc.state to TransientFailure, when the correct behavior would be for the value to remain as Shutdown.

This bug causes resource leaks that make using grpc-go in production unfeasible for us, currently.

iamqizhao added a commit that referenced this pull request Nov 18, 2015
@iamqizhao iamqizhao merged commit e749af2 into grpc:master Nov 18, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants