Repository navigation
[serve] Fix KeyError that stalls the application control loop when a deployment is removed - #66438
Conversation
Signed-off-by: GNITOAHC <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request prevents a potential KeyError in the autoscaling state manager when a deployment is removed from an application but remains registered during teardown. It filters out untargeted deployments in get_decision_num_replicas by checking if the deployment ID is present in deployment_to_target_num_replicas. Additionally, comprehensive unit tests have been added to verify this behavior and ensure the control loop continues running after a deployment is removed. No review comments were provided, so there is no additional feedback.
|
@abrarsheikh Thanks for the review! This is green on the latest commit and all checks have passed. I don't have write access, so could you merge when you get a chance? |
…deployment is removed (ray-project#66438)
fellowship: 提名 GNITOAHC (ray, 2026-11) 建議等級 2 萬 - [x] 關係人宣告:提名人與被提名者無親屬、僱傭、財務、業務合作或其他可能影響公正判斷之利害關係 - 在兩個月內自己從 Ray Serve 原始碼找到 9 個 bug 並開了 PR,其中 6 個 PR 被 Merged ([Merged PRs](https://github.com/ray-project/ray/pulls?q=is%3Apr+author%3AGNITOAHC+is%3Amerged+merged%3A%3C%3D2026-11-24)) - 開了 Gang Scheduling + Autoscaling 的 Issue 並附上 Repro Script,社群後續依此開 PR 修復,提名人則變成該 PR 的 Reviewer ([#67494](ray-project/ray#67494)) - PR Description 簡潔清楚,讓 Reviewer 清楚理解 PR 解決了什麼問題 ([#66358](ray-project/ray#66358), [#66438](ray-project/ray#66438), [#66616](ray-project/ray#66616), [#66910](ray-project/ray#66910)) - 對於 Maintainer 的 Review 會清楚了解之後回覆 ([#67923 comment](ray-project/ray#67923 (comment)), [#67210 comment](ray-project/ray#67210 (comment)), [#66438 comment](ray-project/ray#66438 (comment)))
Description
Removing a deployment from a running application can permanently stall the controller's application control loop.
ApplicationAutoscalingState.get_decision_num_replicasiterates every registered deployment autoscaling state, but indexes the caller'sdeployment_to_target_num_replicaswithout checking membership:Fix: skip registered deployments absent from the caller's mapping, matching the membership guards used elsewhere in the class.
Related issues
No existing issue