Skip to content

Conversation

c9s
Copy link
Owner

@c9s c9s commented Mar 27, 2025

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds retry logic with exponential backoff to the asynchronous time range queries for syncing data.

  • Integrates the backoff library to handle transient query errors.
  • Wraps the query call in a retry loop with a hard-coded maximum retry count.
Comments suppressed due to low confidence (2)

pkg/exchange/batch/time_range_query.go:67

  • Logging each retry attempt may clutter logs if intermittent errors occur; consider logging only after the final retry failure.
log.WithError(err).Errorf("unable to query %T, error: %v", q.Type, err)

pkg/exchange/batch/time_range_query.go:74

  • The maximum retries value of 32 is hard-coded; consider making it a configurable parameter to allow adjustments based on different deployment environments.
backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 32),

@c9s c9s force-pushed the c9s/sync-retry branch from 3a6ad72 to bf1e66a Compare March 27, 2025 09:22
@c9s c9s enabled auto-merge March 27, 2025 09:23
@c9s c9s force-pushed the c9s/sync-retry branch from 83aa4f0 to e9aac58 Compare March 27, 2025 10:02
@c9s c9s merged commit dcb2645 into main Mar 27, 2025
3 checks passed
@c9s c9s deleted the c9s/sync-retry branch March 27, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants