Skip to content

Handle Redis errors gracefully in connection limiter #22675

@bupd

Description

@bupd

Summary

Connection limiter returns HTTP 429 when Redis unavailable, blocking all proxy cache requests.

Expected Behaviour

Redis failures handled gracefully:

  • Allow request to proceed when Redis down (fail open), or
  • Return 503 Service Unavailable instead of 429, or
  • Log error and continue without rate limiting

Actual Behaviour

src/server/middleware/repoproxy/proxy.go:114 and :258

Treats any Acquire() failure as rate limit exceeded:

if !connection.Limiter.Acquire(ctx, client, key, p.MaxUpstreamConnection()) {
    log.Infof("current connection exceed max connections to upstream registry")
    return tooManyRequestsError  // returns 429
}

When Redis unavailable, all proxy cache pulls fail with 429 even though no limit was exceeded. Should differentiate between "limit exceeded" and "Redis error".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions