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

Check for shutdown in inmemPipeline before sending RPCs #276

Merged

Conversation

freeekanayaka
Copy link
Contributor

This change fixes a race inside between the shutdownCh and the
consumerCh in the select statement of inmempipeLine.AppendEntries,
which could otherwise forward an RPC request to the consumer even if
the transport was closed with InmemTransport.Close().

See also #275 for a sample program that reproduces the race if ran
long enough. The same program doesn't fail anymore with this change
applied.

This change fixes a race inside between the shutdownCh and the
consumerCh in the select statement of inmempipeLine.AppendEntries,
which could otherwise forward an RPC request to the consumer even if
the transport was closed with InmemTransport.Close().

See also hashicorp#275 for a sample program that reproduces the race if ran
long enough. The same program doesn't fail anymore with this change
applied.
@freeekanayaka freeekanayaka changed the title Make inmemPipeline check that it's not closed before sending RPCs Check for shutdown in inmemPipeline before sending RPCs Feb 12, 2018
@schristoff schristoff added the bug label Aug 22, 2019
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 🚀

@cgbaker cgbaker merged commit bc879f9 into hashicorp:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants