Skip to content

honour discovery retry_attempts and retry_backoff - #245

Merged
thushan merged 5 commits into
mainfrom
fix/discovery-retries
Oct 27, 2026
Merged

thushan merged 5 commits into
mainfrom
fix/discovery-retries

Conversation

@thushan

@thushan thushan commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

discovery.model_discovery.retry_attempts and retry_backoff were accepted but never used, so one dropped connection failed discovery for that endpoint until the next interval.

discovery/service.go now retries connection errors, timeouts and 5xx responses, doubling retry_backoff (first backoff and later ones capped at 30s). All attempts share the existing timeout, so a cycle never runs longer than before. Parse errors, 4xx responses, oversized listings and TLS certificate verification failures are not retried. A shutdown during backoff is not counted as a failure. A cycle that still fails on a retryable error counts as one failure towards the five-failure cooldown. A negative retry_backoff is rejected at startup (config.go).

Type of change

  • Bug fix
  • Documentation

How was this tested?

New tests in retry_test.go:

  • TestDiscoveryRetry_RecoversFromTransientFailures, _ExhaustedCountsAsOneFailure, _NonRetryableErrorsAreNotRetried
  • TestDiscoveryRetry_ZeroAttemptsMeansOneRequest, _SingleRetryAttempt, _NegativeBackoffBehavesAsZero
  • TestDiscoveryRetry_HonoursCancellationDuringBackoff, _CancelMidBackoffReturnsPromptly, _StopDuringBackoffIsNotAFailure, _StopWithZeroBackoffStopsRetrying
  • TestDiscoveryRetry_CycleStaysWithinOneTimeout, _BackoffLargerThanRemainingTimeoutIsSkipped, _InitialBackoffIsCapped
  • TestDiscoveryRetry_HTTPBackend, TestNextRetryBackoff

Plus a negative-backoff case in config_test.go.

Tested together with the other October follow-up branches on a local integration branch at 0c25e0a:

  • make ready and make test-race pass at 0c25e0a
  • /olla-validate --quick: 42 pass, 0 fail (warnings and skips are nightly-only items)
  • tei-routing validation area: Section A 12/12, Section B B1 to B6 pass
  • /test-sticky-sessions: no new failures (the 7 provider-route 404s are the known shared-mock-URL limitation)
  • /claude-code-e2e against real Ollama: Tier A 16/0 on both the passthrough and translation legs, same as main
  • curl checks per feature against real Ollama and ollamock; log scan shows no panics, races or per-request WARN floods

Checklist

  • make ready passes at 43ce016
  • Tests added or updated for the change
  • Documentation updated: docs/content/configuration/reference.md, v0.0.30 release note
  • No new dependencies added

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between fc1a26e and ba1be88.

Files selected for processing: 9
  • docs/content/about/release-notes.md
  • docs/content/configuration/reference.md
  • internal/adapter/discovery/errors.go
  • internal/adapter/discovery/hardening_test.go
  • internal/adapter/discovery/http_client.go
  • internal/adapter/discovery/retry_test.go
  • internal/adapter/discovery/service.go
  • internal/config/config.go
  • internal/config/config_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thushan
thushan merged commit 9cb5e9f into main Oct 27, 2026
8 checks passed
@thushan
thushan deleted the fix/discovery-retries branch October 27, 2026 21:06
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.

1 participant