cloudfoundry-community / cloudfoundry-community/cf-python-client
Graceful continuation on NOT_FOUND
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 55
- Fork
- 54
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi - We are using cf-python-client as part of a task which downloads each app-blob in turn. As we have tens of thousands of containers, this job takes 8-10 hours to complete.
The job is theoretically quite straightforward...
for app in cfClient.v3.apps:
space_name=app.space()['name']
org_name=app.space().organization()['name']
...
More often than not, during the running of this task, we'll encounter an error along the lines of...
cloudfoundry_client.errors.InvalidStatusCode: NOT_FOUND = {"errors": [{"detail": "Space not found", "title": "CF-ResourceNotFound", "code": 10010}]}
or
cloudfoundry_client.errors.InvalidStatusCode: NOT_FOUND = {"errors": [{"detail": "App not found", "title": "CF-ResourceNotFound", "code": 10010}]}
Given the number of orgs/spaces/apps we have in service, it is not too surprising that an app or space which was present at the start of the task is no longer around 6-8 hours later.
When we encounter an error like this we have no options but to restart the 8-10 hour task from the beginning again and hope that it manages to make it through without an error.
I was just wondering if there are any options to allow for more graceful continuation when objects are no longer found? This doesn't seem to be something that I can handle with a try: except: - Are there any options to make errors like this non-fatal?
Cheers!!
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 từ vòng lặp v3.apps và các lệnh gọi app.space() và space.organization() được nêu trong báo cáo, sau đó theo dõi cách các phản hồi InvalidStatusCode được xử lý. Hoàn thành có nghĩa là có thể bỏ qua NOT_FOUND đối với một app hoặc space trong khi quá trình duyệt chạy dài vẫn tiếp tục, với hành vi được xác định cho các tài nguyên còn lại.
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
- api
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100