Retry decorator on RateLimitExceeded issue
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.1k
- Fork
- 931
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 4
Mô tả
Summary
Enabling retry logic does not work for rate limit exceeded responses.
Detailed Information
retry decorator expects a RateLimitExceeded error to be raised, though session.request method does not raise an exception if a response is returned by the server no matter the status code.
I've tested it on azure_arm driver by setting RETRY_FAILED_HTTP_REQUESTS to True and trying:
while True:
nodes = driver.list_nodes()
print(nodes)
Hitting the throttling limit results in:
Traceback (most recent call last):
File "test.py", line 23, in <module>
nodes = driver.list_nodes()
File "/home/dimgal/libcloud/libcloud/compute/drivers/azure_arm.py", line 395, in list_nodes
r = self.connection.request(action,
File "/home/dimgal/libcloud/libcloud/common/azure_arm.py", line 227, in request
return super(AzureResourceManagementConnection, self) \
File "/home/dimgal/libcloud/libcloud/common/base.py", line 655, in request
response = responseCls(**kwargs)
File "/home/dimgal/libcloud/libcloud/common/base.py", line 165, in __init__
raise exception_from_message(code=self.status,
libcloud.common.exceptions.RateLimitReachedError: 429 Rate limit exceeded
urllib3 supports retries based on HTTP status codes, maybe use this? Let me know how you think this should be handled
Hướng dẫn đóng góp
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.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo retry decorator và luồng request trong libcloud/common/base.py, sau đó so sánh đường dẫn Azure ARM trong libcloud/common/azure_arm.py với lệnh gọi driver azure_arm được nêu trong báo cáo. Tái hiện trường hợp rate limit đã cấu hình và xác định cách một 429 được trả về trở thành RateLimitReachedError. Được xem là hoàn tất khi hành vi retry hoạt động đối với các phản hồi rate limit trong trường hợp logic retry được bật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend, cloud
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100