Dont throw exception in async dofn#3928
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
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
🚀 New features to boost your workflow:
|
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
No description provided.