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

storage: fix a deadlock in rangefeed teardown #33303

Merged

Conversation

petermattis
Copy link
Collaborator

Fix two related deadlocks in rangefeed teardown. The error
channel (errC) used by Processor.Register to indicate a rangefeed
processor is closed needs to be buffered because the caller of
Processor.Register is the reader of this channel. Similarly, we need
to consider that processing might have already placed on error on errC
and that a reader might never read the "closed" error that
Processor.Register is trying to send.

Fixes #33166

Release note: None

Fix two related deadlocks in rangefeed teardown. The error
channel (`errC`) used by `Processor.Register` to indicate a rangefeed
processor is closed needs to be buffered because the caller of
`Processor.Register` is the reader of this channel. Similarly, we need
to consider that processing might have already placed on error on `errC`
and that a reader might never read the "closed" error that
`Processor.Register` is trying to send.

Fixes cockroachdb#33166

Release note: None
@petermattis petermattis requested review from a team and nvanbenschoten December 20, 2018 16:14
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@petermattis
Copy link
Collaborator Author

Ping. Anyone around to review this beauty? It's pretty trivial.

@petermattis
Copy link
Collaborator Author

bors r=mrtracy

craig bot pushed a commit that referenced this pull request Dec 20, 2018
33303: storage: fix a deadlock in rangefeed teardown r=mrtracy a=petermattis

Fix two related deadlocks in rangefeed teardown. The error
channel (`errC`) used by `Processor.Register` to indicate a rangefeed
processor is closed needs to be buffered because the caller of
`Processor.Register` is the reader of this channel. Similarly, we need
to consider that processing might have already placed on error on `errC`
and that a reader might never read the "closed" error that
`Processor.Register` is trying to send.

Fixes #33166

Release note: None

Co-authored-by: Peter Mattis <petermattis@gmail.com>
@craig
Copy link
Contributor

craig bot commented Dec 20, 2018

Build succeeded

@craig craig bot merged commit 8af894d into cockroachdb:master Dec 20, 2018
@petermattis petermattis deleted the pmattis/rangefeed-teardown-deadlock branch December 20, 2018 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

teamcity: failed test: TestChangefeedSchemaChangeAllowBackfill
3 participants