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

Add repeat requests helper method for Google APIs (GSuite) #169

Closed
wants to merge 20 commits into from

Conversation

skiptomyliu
Copy link
Member

@skiptomyliu skiptomyliu commented Oct 1, 2019

  • We make a lot of requests to GSuite. This makes it more resilient in case of a Google server blip, which we've seen.
  • Add retry for GCP compute fetching.
  • Refactor the transform objects method to be more general to prevent copy-pasta.

@skiptomyliu skiptomyliu changed the title Implement repeat requests on GSuite [WIP] Implement repeat requests on GSuite Oct 1, 2019
@skiptomyliu skiptomyliu added the WIP work in progress label Oct 1, 2019
@skiptomyliu skiptomyliu added the keep fresh Disables stalebot from closing an issue label Oct 1, 2019
logger = logging.getLogger(__name__)


def repeat_request(req, req_args, req_next=None, retries=5, retry_delay_ms=500):
Copy link
Contributor

@sachafaust sachafaust Oct 2, 2019

Choose a reason for hiding this comment

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

Could we implement this as generic retry operation we can use across all modules and tasks?

For example of method signature:
invoke_with_retry(operation, retries, retry_delay, retriable_exception_types[])

@skiptomyliu skiptomyliu changed the title [WIP] Implement repeat requests on GSuite [WIP] Add repeat requests helper method for Google APIs (GSuite) Oct 2, 2019
@achantavy
Copy link
Contributor

As @sachafaust, @ecdavis, and I discussed earlier, let's make sure that the cleanup stage does not get executed if all of the retries fail.

@skiptomyliu skiptomyliu changed the title [WIP] Add repeat requests helper method for Google APIs (GSuite) Add repeat requests helper method for Google APIs (GSuite) Oct 8, 2019
@achantavy
Copy link
Contributor

#184 seems to handle the GSuite work. I wonder if we could use a similar approach for GCP in this PR.

@skiptomyliu
Copy link
Member Author

#184 seems to handle the GSuite work. I wonder if we could use a similar approach for GCP in this PR.

Just updated GCP with the retries.

@achantavy achantavy removed the keep fresh Disables stalebot from closing an issue label Feb 6, 2020
@stale
Copy link

stale bot commented Feb 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale stalebot believes this issue/PR is no longer active label Feb 6, 2020
@stale
Copy link

stale bot commented Feb 28, 2020

This issue has been automatically closed for inactivity. If you still wish to make these changes, please open a new change or reopen this one.

@stale stale bot closed this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR is no longer active WIP work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants