Skip to content

Conversation

@VardhanThigle
Copy link
Contributor

@VardhanThigle VardhanThigle commented Dec 4, 2025

Fixes b/465412503.
Allows DLQ retry count for severe retries to be configured by user while keeping the default low (5) as we would want the failing severe errors to not cause sever retry mode take long.

TODO:
Add a test case to check and fix if retries of retry actually happen

@gemini-code-assist
Copy link

Summary of Changes

Hello @VardhanThigle, 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 refines the Dead Letter Queue (DLQ) retry behavior within the datastream-to-spanner template. It introduces a more flexible and context-aware approach to setting the maximum retry count for DLQ processing, differentiating between standard operations and dedicated retry scenarios. This change improves the template's resilience and error handling by providing appropriate retry defaults for different operational modes, backed by robust testing.

Highlights

  • Dynamic DLQ Retry Count: The dlqMaxRetryCount parameter now defaults to -1, which triggers a dynamic assignment of retry counts based on the runMode. In "regular" mode, the default is 500 retries, while in "retryDLQ" mode, it's 5 retries.
  • Run Mode Refactoring: The runMode parameter now uses defined constants (RUN_MODE_REGULAR, RUN_MODE_RETRY) for clarity and consistency across the template.
  • Enhanced Test Coverage: New unit tests have been added for the buildDlqManager method, covering various scenarios for DLQ directory resolution and retry count assignment in both regular and retry modes, including default and custom retry counts.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 54.09%. Comparing base (5874444) to head (8c2f550).
⚠️ Report is 109 commits behind head on main.

Files with missing lines Patch % Lines
...oud/teleport/v2/templates/DataStreamToSpanner.java 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3051      +/-   ##
============================================
+ Coverage     50.42%   54.09%   +3.66%     
+ Complexity     5021     2136    -2885     
============================================
  Files           969      484     -485     
  Lines         59547    28004   -31543     
  Branches       6493     2939    -3554     
============================================
- Hits          30027    15148   -14879     
+ Misses        27398    11924   -15474     
+ Partials       2122      932    -1190     
Components Coverage Δ
spanner-templates 71.72% <90.00%> (+1.08%) ⬆️
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 80.34% <88.88%> (+0.29%) ⬆️
spanner-live-reverse-replication 77.44% <ø> (-0.07%) ⬇️
spanner-bulk-migration 88.27% <100.00%> (-0.02%) ⬇️
Files with missing lines Coverage Δ
...oud/teleport/v2/templates/DataStreamToSpanner.java 27.60% <88.88%> (+8.00%) ⬆️

... and 504 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.

"The max number of times temporary errors can be retried through DLQ. Defaults to `500`.")
@Default.Integer(500)
"The max number of times temporary errors can be retried through DLQ. Defaults to `-1`."
+ "Default value of -1 implies a retry count of `500` when running in regular and `5` when running in retry mode.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The help text does not seem to take concatenation of constants.

description =
"Run mode - currently supported are : " + RUN_MODE_REGULAR + " or " + RUN_MODE_RETRY,
enumOptions = {@TemplateEnumOption(RUN_MODE_REGULAR), @TemplateEnumOption(RUN_MODE_RETRY)},
helpText = "This is the run mode type, whether regular or with retryDLQ.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The help text does not seem to take concatenation of constants.

@VardhanThigle VardhanThigle marked this pull request as ready for review December 4, 2025 09:11
@VardhanThigle VardhanThigle requested a review from a team as a code owner December 4, 2025 09:11
@VardhanThigle VardhanThigle marked this pull request as draft December 4, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant