Skip to content

streamingccl: fix double close in test feed source#68189

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
adityamaru:fix-double-close
Jul 28, 2021
Merged

streamingccl: fix double close in test feed source#68189
craig[bot] merged 1 commit intocockroachdb:masterfrom
adityamaru:fix-double-close

Conversation

@adityamaru
Copy link
Copy Markdown
Contributor

Previously, the close implementation of channelFeedSource
closed the eventCh as a means of shutting down the client.
This seems wrong since the client is the "owner" of this
channel and should be the only one responsible for closing
it. In cases where the method consumeUntil hit an error
(max wait timeout in our case) we would close the eventCh
as part of calling channelFeedSource's Close(), and we would
attempt a double close in the sinkless client itself.

This change switches to cancelling the sinkless client's
context to indicate to the client that it should shutdown.

I was not able to reproduce this error (5000 stress runs),
but I bumped the timeout from 10 seconds to 20 seconds
based on stack traces in the failed builds.

Fixes: #68168
Fixes: #67592

Release note: None

@adityamaru adityamaru requested review from miretskiy and pbardea July 28, 2021 18:00
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @pbardea)

Previously, the close implementation of channelFeedSource
closed the `eventCh` as a means of shutting down the client.
This seems wrong since the client is the "owner" of this
channel and should be the only one responsible for closing
it. In cases where the method `consumeUntil` hit an error
(max wait timeout in our case) we would close the eventCh
as part of calling channelFeedSource's Close(), and we would
attempt a double close in the sinkless client itself.

This change switches to cancelling the sinkless client's
context to indicate to the client that it should shutdown.

I was not able to reproduce this error (5000 stress runs),
but I bumped the timeout from 10 seconds to 20 seconds
based on stack traces in the failed builds.

Fixes: cockroachdb#68168
Fixes: cockroachdb#67592

Release note: None
@adityamaru
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=miretskiy

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2021

Build succeeded:

@craig craig bot merged commit dbd4e53 into cockroachdb:master Jul 28, 2021
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.

streamclient: panic in TestSinklessReplicationClient streamclient: panic in TestIdleExit

3 participants