Skip to content

Dont throw exception in async dofn#3928

Merged
claudevdm merged 1 commit into
GoogleCloudPlatform:mainfrom
claudevdm:fix-transient
Jun 17, 2026
Merged

Dont throw exception in async dofn#3928
claudevdm merged 1 commit into
GoogleCloudPlatform:mainfrom
claudevdm:fix-transient

Conversation

@claudevdm

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.15%. Comparing base (2b78140) to head (b7a9f68).
⚠️ Report is 32 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (2b78140) and HEAD (b7a9f68). Click for more details.

HEAD has 8 uploads less than BASE
Flag BASE (2b78140) HEAD (b7a9f68)
9 1
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3928       +/-   ##
=============================================
- Coverage     55.52%   38.15%   -17.38%     
+ Complexity     7018      510     -6508     
=============================================
  Files          1103      195      -908     
  Lines         67557    11697    -55860     
  Branches       7576     1167     -6409     
=============================================
- Hits          37512     4463    -33049     
+ Misses        27626     6877    -20749     
+ Partials       2419      357     -2062     
Components Coverage Δ
spanner-templates ∅ <ø> (∅)
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration ∅ <ø> (∅)
spanner-live-reverse-replication ∅ <ø> (∅)
spanner-bulk-migration ∅ <ø> (∅)
gcs-spanner-dv ∅ <ø> (∅)
see 935 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claudevdm claudevdm requested a review from damccorm June 17, 2026 15:48
@claudevdm claudevdm marked this pull request as ready for review June 17, 2026 15:48
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the webhook anomaly detection pipeline to handle transient failures more robustly. By moving retry logic inline within the DoFn, the pipeline avoids the reliability issues associated with relying on bundle-level retries in Dataflow, which could otherwise lead to bundle crash-loops. The changes ensure that transient errors are retried with exponential backoff and permanent errors are logged and dropped, maintaining pipeline stability.

Highlights

  • Inline Retry Logic: Implemented an inline retry mechanism with exponential backoff for transient webhook failures, replacing the previous approach of raising exceptions to trigger bundle retries.
  • Exception Handling: Modified the process method to ensure no exceptions escape, preventing potential crash-loops in the AsyncWrapper.
  • Testing: Added comprehensive unit tests covering various failure scenarios, including transient status codes, network errors, and non-request exceptions, using a new sequence-based session stub.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@claudevdm claudevdm added the improvement Making existing code better label Jun 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an inline retry policy with exponential backoff for transient webhook failures inside the _PostAnomalyToWebhook class to prevent AsyncWrapper from entering crash loops. It also adds comprehensive unit tests to verify the retry logic, backoff schedule, and error handling. The reviewer points out a potential thread-safety issue because requests.Session is not thread-safe when executed concurrently by AsyncWrapper's thread pool, and suggests using a thread-local session to resolve this.

@claudevdm claudevdm merged commit 3c54627 into GoogleCloudPlatform:main Jun 17, 2026
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Making existing code better size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants