Skip to content

refactor: increase the retry timeout and wrap the error for retry#221

Merged
chlins merged 1 commit into
mainfrom
refactor/increase-retry-timeout
Jul 2, 2025
Merged

refactor: increase the retry timeout and wrap the error for retry#221
chlins merged 1 commit into
mainfrom
refactor/increase-retry-timeout

Conversation

@chlins

@chlins chlins commented Jul 2, 2025

Copy link
Copy Markdown
Member

This pull request introduces logging enhancements and updates to retry configurations across the codebase. The changes improve error visibility by adding detailed logs and adjust retry mechanisms to handle failures more robustly.

Logging Enhancements:

  • Added the logrus dependency to internal/pb/pb.go for structured logging.
  • Enhanced the Abort method in internal/pb/pb.go to log errors when aborting a progress bar.
  • Updated error handling in pkg/backend/processor/base.go and pkg/backend/pull.go to log errors using logrus.Error for better traceability. [1] [2]
  • Added debug and error logs in pkg/backend/pull_by_d7y.go to provide detailed information during layer processing.

Retry Configuration Updates:

  • Increased the default retry attempts from 3 to 4 and adjusted delay values for retries in pkg/backend/processor/options.go and pkg/backend/retry.go. Delays were updated to 10 seconds with a maximum of 20 seconds to improve resilience. [1] [2]

@chlins chlins added the enhancement New feature or request label Jul 2, 2025

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary of Changes

Hello @chlins, 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 primarily focuses on enhancing the robustness and observability of the system. It introduces more detailed error logging across several components and significantly adjusts the retry mechanisms to improve resilience against transient failures.

Highlights

  • Enhanced Error Logging: I've integrated logrus for structured logging and improved error visibility by adding detailed error messages, especially when aborting progress bars or processing layers. Errors are now consistently wrapped for better traceability.
  • Adjusted Retry Configurations: I've increased the default number of retry attempts from 3 to 4 and extended the retry delays (from 5s to 10s, with max delay from 10s to 20s) in core backend processing and retry logic, aiming for more robust handling of temporary issues.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

The pull request enhances logging and updates retry configurations. Error wrapping inconsistencies and code duplication were identified.

Comment thread pkg/backend/processor/base.go Outdated
Comment thread pkg/backend/pull.go
Comment thread pkg/backend/pull_by_d7y.go
Comment thread pkg/backend/retry.go
Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins force-pushed the refactor/increase-retry-timeout branch from 6bb0989 to aa99976 Compare July 2, 2025 08:03

@gaius-qi gaius-qi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@chlins chlins merged commit 2b92adf into main Jul 2, 2025
5 checks passed
@chlins chlins deleted the refactor/increase-retry-timeout branch July 2, 2025 08:08
SAY-5 added a commit to SAY-5/modctl that referenced this pull request May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants