Skip to content

窗口级限流触发 429 时,Retry-After 头问题 #1157

Description

@SeoMP

窗口级限流(rpd/tpd 等)触发 429 时,Retry-After 头的值是「到窗口边界的剩余秒数」,无上限钳制。rpd 在 UTC 天初触发时该值可达 86000+(接近一整天)。严格遵循该头的客户端(如实测 Goose会按头静默休眠)会长时间无响应,表现为“卡死”。
现状:

  • 头在 apply_retry_headers(crates/aisix-proxy/src/error.rs:775)原样写出,RateLimitError::retry_after_secs() 恒返回 Some,无开关
  • config.yaml ratelimit 段(deny_unknown_fields)、限流策略 schema 均无相关字段
    期望:
    提供配置项对限流 429 的 Retry-After 做钳制:min(窗口剩余秒数, 配置上限),0 表示整个省略该头(客户端按自身退避策略快速失败)。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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