{
  "id": "go/grpc-unavailable-rate-limit",
  "signature": "rpc error: code = Unavailable desc = rate limit exceeded: retry after 30 seconds",
  "signature_zh": "rpc错误：代码=不可用 描述=超过速率限制：请在30秒后重试",
  "regex": "rpc\\ error:\\ code\\ =\\ Unavailable\\ desc\\ =\\ rate\\ limit\\ exceeded:\\ retry\\ after\\ 30\\ seconds",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The client has sent too many requests in a short period, exceeding the server's rate limit.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端在短时间内发送了太多请求，超过了服务器的速率限制。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Ignore the retry-after header and keep sending requests.",
      "why_fails": "The server will continue to reject requests until the rate limit resets.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the rate limit on the client side only.",
      "why_fails": "Rate limiting is enforced by the server; client-side changes don't affect it.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Honor the retry-after duration and implement backoff.",
      "success_rate": 0.9,
      "how": "for {\n    resp, err := client.SomeRPC(ctx, req)\n    if err == nil { return resp }\n    if st, ok := status.FromError(err); ok && st.Code() == codes.Unavailable {\n        // Extract retry-after from metadata or message\n        time.Sleep(30 * time.Second)\n        continue\n    }\n    return err\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement client-side rate limiting to avoid hitting server limits.",
      "success_rate": 0.85,
      "how": "limiter := rate.NewLimiter(rate.Limit(10), 1) // 10 requests per second\nfor {\n    err := limiter.Wait(ctx)\n    if err != nil { return err }\n    resp, err := client.SomeRPC(ctx, req)\n    if err == nil { return resp }\n}",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-10-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}