Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces configurability for several knobs in DefaultClusterAutoscalerV2 via environment variables, which is a great improvement for flexibility. It also refactors the class to allow dependency injection for the autoscaling coordinator and node count provider, improving testability. The changes are well-structured. I've found one bug in a log message that could be misleading, and I've also suggested a minor refactoring for more idiomatic code.
| @@ -206,7 +249,7 @@ def on_executor_shutdown(self): | |||
| msg = ( | |||
| f"Failed to cancel resource request for {self._requester_id}." | |||
| " The request will still expire after the timeout of" | |||
| f" {self.MIN_GAP_BETWEEN_AUTOSCALING_REQUESTS} seconds." | |||
| f" {self._min_gap_between_autoscaling_requests_s} seconds." | |||
There was a problem hiding this comment.
The log message here incorrectly uses _min_gap_between_autoscaling_requests_s as the expiration timeout. The actual expiration timeout is defined by AUTOSCALING_REQUEST_EXPIRE_TIME_S. This was also an issue in the previous version of the code. Using the wrong variable can be misleading when debugging. Please use self.AUTOSCALING_REQUEST_EXPIRE_TIME_S instead.
f" {self.AUTOSCALING_REQUEST_EXPIRE_TIME_S} seconds."| if autoscaling_coordinator is None: | ||
| autoscaling_coordinator = DefaultAutoscalingCoordinator() | ||
| self._autoscaling_coordinator = autoscaling_coordinator |
There was a problem hiding this comment.
bveeramani
left a comment
There was a problem hiding this comment.
I think there are some merge conflicts. Would you mind resolve thme?
3881492 to
8f1f762
Compare
| f" {self._min_gap_between_autoscaling_requests_s} seconds." | ||
| f" {self.AUTOSCALING_REQUEST_EXPIRE_TIME_S} seconds." |
…riables Signed-off-by: Alice C <[email protected]>
8f1f762 to
8371e1c
Compare
…5317) The warning logged when cancelling a resource request fails during executor shutdown reports `_min_gap_between_autoscaling_requests_s` (default 10s) as the expiry timeout, but the request is actually submitted with `expire_after_s=AUTOSCALING_REQUEST_EXPIRE_TIME_S` (default 180s) in `_send_resource_request`. This corrects the log message to reference the real expiry value, so operators debugging shutdown behavior aren't misled about how long a stale resource request will linger. Log-message-only change; no behavior change. Related to #60111 (originally identified there) Verified the referenced constant matches the `expire_after_s` value used in `_send_resource_request` on current master. Signed-off-by: Alice C <[email protected]> Co-authored-by: Balaji Veeramani <[email protected]>
…y-project#65317) The warning logged when cancelling a resource request fails during executor shutdown reports `_min_gap_between_autoscaling_requests_s` (default 10s) as the expiry timeout, but the request is actually submitted with `expire_after_s=AUTOSCALING_REQUEST_EXPIRE_TIME_S` (default 180s) in `_send_resource_request`. This corrects the log message to reference the real expiry value, so operators debugging shutdown behavior aren't misled about how long a stale resource request will linger. Log-message-only change; no behavior change. Related to ray-project#60111 (originally identified there) Verified the referenced constant matches the `expire_after_s` value used in `_send_resource_request` on current master. Signed-off-by: Alice C <[email protected]> Co-authored-by: Balaji Veeramani <[email protected]>
Summary
Testing