Mitigation eval passes when the broken workload is deleted or scaled to zero
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reading MitigationTask.wait_until_pods_healthy, pods_unhealthy_reasons, and KubeCtl._pod_is_ready_or_succeeded, then compare the four problems that use their own pod checks. The reproduction uses revoke_auth_mongodb-mitigation-1 and a kind cluster; first verify the reported scale-to-zero case. Done means eval fails when a required workload is missing or scaled to zero, and the listed false-success cases are covered.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Most mitigation problems use MitigationTask.wait_until_pods_healthy to decide if a fix worked. This check only looks at pods that exist. It also skips pods that have no container statuses.
Because of this, eval can report success while the service is still broken. I found four ways this happens:
- The broken workload is deleted or scaled to 0. Its crashing pods disappear. All the pods that are left look healthy. Eval passes.
- A healthy workload is scaled to 0. Its pods disappear too. Eval passes.
- A pod cannot be scheduled. It stays
Pendingand has no container statuses. The check skips it. Soassign_to_non_existent_node_social_net-mitigation-1passes even when the agent does nothing. - The fault is a feature flag.
astronomy_shop_kafka_queue_problems-mitigation-1turns on a flagd feature flag. Every pod stays healthy. So eval passes even when the agent does nothing.
How to reproduce
I tested this on main (commit ccf08d0) with a kind cluster.
- Start
revoke_auth_mongodb-mitigation-1. Thegeopods start crash-looping because MongoDB rejects their credentials. - Run
kubectl scale deployment geo -n hotel-reservation --replicas=0. - Call
submit(). - Eval returns success once the
geopods are gone. But every request that needsgeostill fails.
What I measured
I ran all 14 mitigation problems once each. After each change, I polled eval for 120 seconds. This is the same window AIOpsLab uses by default. I also checked the cluster myself: ready replicas, Service endpoints, and wrk2 requests.
| What I did after the fault | How often eval passed |
|---|---|
| Scaled the broken Deployment to 0 | 5 of 6 problems |
| Deleted the broken Deployment | 5 of 6 problems |
Ran recover_fault(), then scaled a healthy Deployment to 0 |
13 of 13 problems |
| Did nothing and polled eval for 300 seconds | 3 of 14 problems passed the whole time |
Notes on the table:
- The first two rows apply only to the 6 problems that leave a Deployment unhealthy after the fault.
- The 3 problems that passed with no action are
assign_to_non_existent_node_social_net,astronomy_shop_kafka_queue_problemsandredeploy_without_PV. misconfig_app_hotel_resalso passed in its first few polls with no action.- In every pass from the first three rows, my own check showed the removed workload had no ready replicas. If the workload had a Service, that Service had no endpoints.
Why it happens
pods_unhealthy_reasonsskips any pod with emptycontainer_statuses. ButKubeCtl._pod_is_ready_or_succeededtreats the same pod as not ready. The two checks disagree.- Nothing records which workloads the app deployed. So when a workload is deleted or scaled to 0, the pod list shows nothing wrong.
- Four problems use their own pod checks instead:
misconfig_app_hotel_res,wrong_bin_usage,redeploy_without_pvandscale_pod_social_net.- They also miss a workload that was deleted or scaled to 0. Two of them check one workload by name, but no others.
- They do not use the settle window from #180.
- Three of them loop over
pod.status.container_statuseswithout checking forNone. APendingpod makes them raise aTypeError.
Suggested fix
I will open a PR with these changes:
- Treat a pod with no container statuses as unhealthy, unless it has finished successfully.
- Record the Deployments and StatefulSets right after the app is deployed, before the fault is injected. Then fail if a recorded workload is gone or scaled to 0.
- Make the four problems above use the shared check.
- In the kafka problem, also check that the
kafkaQueueProblemsflag isoffagain.
Not covered by this fix
redeploy_without_PV: the pods come back healthy without their volumes. Pod state cannot show this data loss.misconfig_app_hotel_res: eval can pass before the crash shows up. Fixing this needs the app to stay healthy for a while, not just once.
- Ngôn ngữ chính
- Python
- Star
- 1k
- Fork
- 177
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của microsoft/AIOpsLab
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Regarding to the case #162Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của microsoft/AIOpsLab
Issue tương tự
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
btclib-org/btclib-node#1955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation v0.9.2
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
khuisman/mcp-gee-sweet#1033 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ossf/cve-bin-tool#5966 ·
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 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
write_iceberg ignores the table's write.parquet.compression-codec propertyCó thể đã có người làm @YuangGao đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Eventual-Inc/Daft#7606 ·
Maintainer thường phản hồi trong vòng 1 ngày