GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core

This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Conversation

@daniel-sanche

@daniel-sanche daniel-sanche commented May 3, 2024

Copy link
Copy Markdown
Contributor

We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function

This is a useful check, but the implementation adds significant overhead, almost doubling the processing time in a quick benchmark I ran (0.94s -> 1.84s)

This PR moves the check to happen once at wrap time, instead of on each retry attempt. This should give us most of the benefits, without the ongoing performance hit

Note that this implementaiton isn't quite as thouogh as the previous one: iscouroutinefunction won't catch standard functions that happen to return an awaitable, like the previous implementation would. But I think this trade-off is worth it for the performance gain

Fixes #542

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@daniel-sanche
chore: move retry async check to wrap time
3083ec0
@daniel-sanche
daniel-sanche requested review from a team May 3, 2024 19:51
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label May 3, 2024
@blunderbuss-gcf blunderbuss-gcf Bot assigned parthea May 3, 2024
gcf-owl-bot Bot and others added 3 commits May 3, 2024 19:53
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
3d3c338
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@daniel-sanche
Merge branch 'main' into move_async_warning
7026cc0
@daniel-sanche
added no cover mark
3d4bb2c
parthea
parthea approved these changes Jun 4, 2024
View reviewed changes
@parthea
Merge branch 'main' into move_async_warning
f72f5da
@parthea
parthea enabled auto-merge (squash) June 4, 2024 11:46
@parthea
parthea merged commit ac098a7 into main Jun 4, 2024
@parthea
parthea deleted the move_async_warning branch June 4, 2024 11:47
parthea added a commit that referenced this pull request Jun 5, 2024
@parthea
Revert "chore: move retry async check to wrap time (#649)"
b91d074
This reverts commit ac098a7.
@parthea parthea mentioned this pull request Jun 5, 2024
chore(revert): Revert "chore: move retry async check to wrap time (#649)" #667
Merged
parthea added a commit that referenced this pull request Jun 5, 2024
@parthea
chore(revert): Revert "chore: move retry async check to wrap time (#649…
126b5c7
…)" (#667)

This reverts commit ac098a7.
@parthea
parthea restored the move_async_warning branch June 5, 2024 16:16
@parthea parthea mentioned this pull request Jun 5, 2024
chore: move retry async check to wrap time #668
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@parthea parthea parthea approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@parthea parthea

Labels

size: s Pull request size is small.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Raise a warning in google.api_core.retry.retry_target if the return value is awaitable

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@daniel-sanche @parthea
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.