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

Đang mở Phù hợp với người mới
#1,608 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
documentation

Hướng nghiên cứu

Đọc chú thích của NextRetry trong internal/retrypolicy/default.go cùng với phần triển khai, sau đó kiểm tra chú thích của Config.RetryPolicy trong retry_policy.go. Ghi lại phạm vi jitter, số lần thất bại dựa trên lỗi và giới hạn thời lượng tối đa, đồng thời liên kết đến DefaultClientRetryPolicy. Hoàn tất khi cả hai chú thích mô tả chính xác hành vi; issue không nêu bài kiểm thử nào cần chạy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
5.9k
Fork
205
Merge trung bình
12 giờ 2 phút
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của riverqueue/river

Tất cả issue của riverqueue/river

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.