-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
importccl: Correctly handle cancelled context when importing #43789
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When calling sendRequest with the cancelled context, ensure that we return appropriate error to the caller. Release note (bug fix): handle cancelled context in sendRequest
dt
approved these changes
Jan 7, 2020
bors r+ |
craig bot
pushed a commit
that referenced
this pull request
Jan 7, 2020
43789: importccl: Correctly handle cancelled context when importing r=miretskiy a=miretskiy When calling sendRequest with the cancelled context, ensure that we return appropriate error to the caller. Release note (bug fix): handle cancelled context in sendRequest Fixes #43783 Co-authored-by: Yevgeniy Miretskiy <yevgeniy@cockroachlabs.com>
Build succeeded |
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this pull request
Jul 10, 2020
This commit updates the Retry utility to always guarantee at least a single iteration of the retry loop. This fixes a previously-buggy pattern that we have throughout the codebase where we would assume that a retry loop would be executed at least once. With this false understanding, we would try to return the error found in the last iteration of the retry loop. This could cause us to return no error at all if the loop never ran, which would trick upper levels into thinking the retry loop had succeeded. One instance of this bug was fixed in cockroachdb#43789. Here are five other instances of the pattern that I believe are currently susceptible to the bug: - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/changefeedccl/changefeed_stmt.go#L568 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/workloadccl/fixture.go#L136 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/kv/kvserver/replica_command.go#L529 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sql/schema_changer.go#L1701 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sqlmigrations/migrations.go#L580 And a sixth was almost introduced in cockroachdb#51227.
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this pull request
Jul 10, 2020
This commit updates the Retry utility to always guarantee at least a single iteration of the retry loop. This fixes a previously-buggy pattern that we have throughout the codebase where we would assume that a retry loop would be executed at least once. With this false understanding, we would try to return the error found in the last iteration of the retry loop. This could cause us to return no error at all if the loop never ran, which would trick upper levels into thinking the retry loop had succeeded. One instance of this bug was fixed in cockroachdb#43789. Here are five other instances of the pattern that I believe are currently susceptible to the bug: - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/changefeedccl/changefeed_stmt.go#L568 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/workloadccl/fixture.go#L136 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/kv/kvserver/replica_command.go#L529 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sql/schema_changer.go#L1701 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sqlmigrations/migrations.go#L580 And a sixth was almost introduced in cockroachdb#51227.
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this pull request
Jul 10, 2020
This commit updates the Retry utility to always guarantee at least a single iteration of the retry loop. This fixes a previously-buggy pattern that we have throughout the codebase where we would assume that a retry loop would be executed at least once. With this false understanding, we would try to return the error found in the last iteration of the retry loop. This could cause us to return no error at all if the loop never ran, which would trick upper levels into thinking the retry loop had succeeded. One instance of this bug was fixed in cockroachdb#43789. Here are five other instances of the pattern that I believe are currently susceptible to the bug: - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/changefeedccl/changefeed_stmt.go#L568 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/workloadccl/fixture.go#L136 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/kv/kvserver/replica_command.go#L529 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sql/schema_changer.go#L1701 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sqlmigrations/migrations.go#L580 And a sixth was almost introduced in cockroachdb#51227.
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this pull request
Jul 10, 2020
This commit updates the Retry utility to always guarantee at least a single iteration of the retry loop. This fixes a previously-buggy pattern that we have throughout the codebase where we would assume that a retry loop would be executed at least once. With this false understanding, we would try to return the error found in the last iteration of the retry loop. This could cause us to return no error at all if the loop never ran, which would trick upper levels into thinking the retry loop had succeeded. One instance of this bug was fixed in cockroachdb#43789. Here are five other instances of the pattern that I believe are currently susceptible to the bug: - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/changefeedccl/changefeed_stmt.go#L568 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/workloadccl/fixture.go#L136 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/kv/kvserver/replica_command.go#L529 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sql/schema_changer.go#L1701 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sqlmigrations/migrations.go#L580 And a sixth was almost introduced in cockroachdb#51227.
craig bot
pushed a commit
that referenced
this pull request
Jul 10, 2020
51310: util/retry: always run at least one iteration r=nvanbenschoten a=nvanbenschoten This commit updates the Retry utility to always guarantee at least a single iteration of the retry loop. This fixes a previously-buggy pattern that we have throughout the codebase where we would assume that a retry loop would be executed at least once. With this false understanding, we would try to return the error found in the last iteration of the retry loop. This could cause us to return no error at all if the loop never ran, which would trick upper levels into thinking the retry loop had succeeded. One instance of this bug was fixed in #43789. Here are five other instances of the pattern that I believe are currently susceptible to the bug: - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/changefeedccl/changefeed_stmt.go#L568 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/ccl/workloadccl/fixture.go#L136 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/kv/kvserver/replica_command.go#L529 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sql/schema_changer.go#L1701 - https://github.com/cockroachdb/cockroach/blob/d0c79625eda85d3aa38afad5b0254d419a9bc4cd/pkg/sqlmigrations/migrations.go#L580 And a sixth was almost introduced in #51227. Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When calling sendRequest with the cancelled context, ensure
that we return appropriate error to the caller.
Release note (bug fix): handle cancelled context in sendRequest
Fixes #43783