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

fix: make nested retry blocks work for RPC calls #589

Merged
merged 4 commits into from
Jan 21, 2021

Conversation

cguardia
Copy link
Contributor

fixes #567

@cguardia cguardia requested a review from andrewsg as a code owner January 15, 2021 08:53
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 15, 2021
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-ndb API. label Jan 15, 2021
@cguardia
Copy link
Contributor Author

@andrewsg this is weird, if I run lint locally it passes, but Kokoro says it failed.

@andrewsg andrewsg added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 15, 2021
@andrewsg
Copy link
Contributor

Looks like a transient error, let's run it again and cross fingers

Copy link
Contributor

@andrewsg andrewsg left a comment

Choose a reason for hiding this comment

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

Thanks for your work here!

@@ -544,6 +546,12 @@ def policy(key):

set_memcache_timeout_policy = set_global_cache_timeout_policy

def set_retry_state(self, state):
self.retry = state
Copy link
Contributor

Choose a reason for hiding this comment

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

This instance variable is only accessed through setters and getters, so let's indicate it's private, like self._retry

@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 16, 2021
@cguardia
Copy link
Contributor Author

@andrewsg I believe this is a better approach than the original work. This removes the need for the datastore API having to know about the retry state, thus making nested retries work for other use cases.

Copy link
Contributor

@andrewsg andrewsg left a comment

Choose a reason for hiding this comment

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

Thanks!

@andrewsg andrewsg merged commit f125459 into googleapis:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/python-ndb API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InvalidArgument: 400 The referenced transaction has expired or is no longer valid.
3 participants