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: retry if failure occurs on initial call in MutateRows #123
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,11 @@ | |
from grpc import StatusCode | ||
|
||
from google.api_core import timeout | ||
from google.api_core.exceptions import RetryError | ||
from google.api_core.exceptions import Aborted | ||
from google.api_core.exceptions import DeadlineExceeded | ||
from google.api_core.exceptions import NotFound | ||
from google.api_core.exceptions import RetryError | ||
from google.api_core.exceptions import ServiceUnavailable | ||
from google.api_core.retry import if_exception_type | ||
from google.api_core.retry import Retry | ||
from google.api_core.gapic_v1.method import wrap_method | ||
|
@@ -1078,9 +1081,15 @@ def _do_mutate_retryable_rows(self): | |
client_info=data_client._client_info, | ||
) | ||
|
||
responses = data_client._inner_api_calls["mutate_rows"]( | ||
mutate_rows_request, retry=None | ||
) | ||
try: | ||
responses = data_client._inner_api_calls["mutate_rows"]( | ||
mutate_rows_request, retry=None | ||
) | ||
except (ServiceUnavailable, DeadlineExceeded, Aborted): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this PR change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# If an exception, considered retryable by `RETRY_CODES`, is | ||
# returned from the initial call, consider | ||
# it to be retryable. Wrap as a Bigtable Retryable Error. | ||
raise _BigtableRetryableError | ||
|
||
num_responses = 0 | ||
num_retryable_responses = 0 | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this already handled in read rows or does it need to be added there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all methods that changed: googleapis/googleapis@a175708
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid call out. this may need to be done broadly to manage the initial setup calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both "read_rows" and "sample_rows" return the raw api call right now. So I think this is complete for now, as we do no special handling beyond gapic configs for these.