Document the default River retry jitter and correct the default-policy type reference

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

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1-3 小時
新手友好度
88/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
documentation

研究方向

請搭配實作閱讀 internal/retrypolicy/default.go 中 NextRetry 的註解,接著檢查 retry_policy.go 中 Config.RetryPolicy 的註解。記錄 jitter 範圍、根據錯誤計算的失敗次數,以及最長時間上限,並連結至 DefaultClientRetryPolicy。兩處註解都準確描述行為後即完成;issue 未指定要執行的測試。

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

描述

The doc comment on DefaultClientRetryPolicy.NextRetry describes a fourth-power delay in seconds, for example 16 seconds after the second failure. The implementation in internal/retrypolicy/default.go applies up to 10% jitter in either direction, so in that example the delay is approximately 14.4 to 17.6 seconds.

The comment should describe the jitter range, that the failure count is taken from the recorded errors, and the cap at the maximum Go duration. Once the base delay reaches the cap, the scheduled delay stays at the cap. This is needed to interpret retry timestamps and to write assertions with correct bounds.

Separately, the comment on Config.RetryPolicy refers to DefaultRetryPolicy. The exported type is DefaultClientRetryPolicy, and the comment should link to it.

retry_policy.go · internal/retrypolicy/default.go · PR #1023 · client.go

主要語言
Go
星號
5.9k
分支
205
平均合併
12 小時 2 分鐘
30 天內合併 PR
24

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

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

riverqueue/river 的其他 Issue

查看 riverqueue/river 的全部 Issue

相似的 Issue

更多 Go Issue

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

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