Per-request retry_params.min_wait_in_ms overwrites max_retry
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu trong openfga_sdk/api_client.py và bản tương ứng đồng bộ của nó, đọc khối _retry_params cho từng request và hành vi của RetryParams được mô tả trong issue. Cập nhật cả hai đường thực thi để thiết lập thời gian chờ cho từng request không thay thế max_retry, sau đó kiểm thử kịch bản list_objects với max_retry=0 và xác nhận rằng các giới hạn retry cũng như thiết lập thời gian chờ hoạt động như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug
In openfga_sdk/api_client.py (and the sync twin), applying per-request _retry_params assigns min_wait_in_ms onto max_retry:
if _retry_params is not None:
if _retry_params.max_retry is not None:
max_retry = _retry_params.max_retry
if _retry_params.min_wait_in_ms is not None:
max_retry = _retry_params.min_wait_in_ms # should be min_wait_in_ms =
if _retry_params.max_wait_in_sec is not None:
max_wait_in_sec = _retry_params.max_wait_in_sec
Introduced in https://github.com/openfga/python-sdk/commit/fb553501c29e38ff21d04ac4afccae83f995b6d2 (feat: improved handling of retries (#188)). Still present on main and in v0.10.4 (latest PyPI as of 2026-09-26).
RetryParams.__init__ always sets min_wait_in_ms (default 100), so any per-request RetryParams overwrites max_retry with the wait-in-ms value.
Impact
await client.list_objects(body, options={"retry_params": RetryParams(max_retry=0)})
Intended: 1 attempt (range(0 + 1)).
Actual: max_retry becomes 100 → 101 attempts on 5xx (range(100 + 1)).
Same bug in openfga_sdk/sync/api_client.py.
Expected
if _retry_params.min_wait_in_ms is not None:
min_wait_in_ms = _retry_params.min_wait_in_ms
Workaround
Pass a duck-typed object with max_retry=0 and min_wait_in_ms=None so the broken assignment is skipped.
- Ngôn ngữ chính
- Python
- Star
- 85
- Fork
- 36
- Merge trung bình
- 4 giờ 22 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openfga/python-sdk
-
Prevent generator syncs from regressing the README versionCó thể làm lại được @SoulPancake đã nhận 55 ngày trước và không có pull request nào đang mở. Đang mở
openfga/python-sdk#308 · 1 người được giao ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
openfga/python-sdk#214 · 1 bình luận · 1 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
openfga/python-sdk#194 · 2 bình luận ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
openfga/python-sdk#139 · 1 bình luận ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
openfga/python-sdk#106 · 2 bình luận ·
Tất cả issue của openfga/python-sdk
Issue tương tự
-
Broken links found in docsĐang mởdocs pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
pydantic/pydantic-ai#8863 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
run-llama/llama_index#23278 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
documentation from-review-extraction github-actions priority: low severity:nit
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
LearningCircuit/local-deep-research#6946 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
oracle/langchain-oracle#323 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
tenstorrent/tt-metal#58057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày