Rate limits from later headers shorten longer active limits

未關閉 適合新手
#8,296 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@sentry-junior 已經在處理了。

開始於 2026年11月16日。

  • #8297 來自 @sentry-junior —— 未關閉
  • #8336 來自 @Kayvan-Zahiri —— 已關閉,未合併

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
api, backend

研究方向

從 _parse_rate_limits 和 sentry_sdk/transport.py 中對 self._disabled_until 的更新開始,接著閱讀連結的速率限制規格。檢查同一標頭中的限制、後續回應和 429 回應如何互相影響。針對較長限制仍有效時收到較短限制的情況,新增或更新 transport 測試;完成條件是該類別持續停用,直到較長限制到期。

由索引模型根據 Issue 內容生成。

描述

Python

HttpTransportCore stores the last rate limit it sees for each category. A shorter limit therefore replaces a longer one that is still active, and the SDK starts sending that category before the longer quota expires.

  • _parse_rate_limits yields one entry per group, and self._disabled_until.update(...) keeps the last one. With 3600:error:organization, 0:error:project, errors are not limited.
  • The same overwrite happens across separate responses. A 429 also overwrites the all-categories limit (L359).
  • The spec says: "If a new rate limit is shorter than an already stored rate limit, then keep the longer one."

@itsrayeedscodespace reported this bug in the Rust SDK in getsentry/sentry-rust#1409. A check of the other SDKs found the same behavior here.

via @szokeasaurusrex.

--

View Session [Sentry]

主要語言
Python
星號
2.2k
分支
713
平均合併
1 天 16 分鐘
30 天內合併 PR
113

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-python 的其他 Issue

查看 getsentry/sentry-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。