Kuadrant / Kuadrant/developer-portal-controller

OpenAPI fetch should retry temporary errors with backoff limit

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement triage/accepted
Dominant language
Go
Stars
2
Forks
12
Avg merge
13h 37m
Merged PRs (30d)
5

Description

Problem

When OpenAPI spec fetch fails, the error is persisted in the OpenAPISpecReady status condition. Due to generation-based caching, the controller does not retry fetching unless the spec changes.

This means:

  • Temporary failures (network timeout, server 503) require manual spec edits to trigger retry
  • Permanent failures (404, invalid URL) would waste resources if blindly retried

Desired Behavior

The controller should:

  1. Distinguish error types

    • Temporary: network errors, rate limiting (429), server errors (5xx)
    • Permanent: not found (404), auth failures (401/403), invalid URL, spec too large
  2. Retry temporary errors automatically

    • Without requiring spec changes
    • With exponential backoff between attempts
    • Limited to prevent infinite retries
  3. Stop retrying after limit reached

    • Either by number of attempts (e.g., 5 retries)
    • Or by time window (e.g., retry for up to 1 hour)
    • After limit, treat as permanent failure
  4. Persist retry state in status

    • Users should see retry progress in conditions or status fields
    • Example: "FetchFailed (attempt 3/5)" or "last attempted 2 minutes ago"
  5. Reset retry state on:

    • Successful fetch
    • Spec change (generation update)
  6. Never retry permanent errors

    • Keep existing cached error behavior for these

Acceptance Criteria

  • Temporary errors retry without manual intervention
  • Retries use exponential backoff
  • Retries stop after reaching limit
  • Permanent errors don't retry
  • Retry state is visible to users
  • Tests verify temporary vs permanent error handling

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the controller's OpenAPISpecReady condition and generation-based cache behavior. Use the acceptance criteria to identify temporary versus permanent fetch errors and the retry state that must be visible, then add tests covering backoff, retry limits, resets, and non-retryable errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.