Skip to content

[Serve] set last scale up/down time on autoscaling context#59057

Merged
abrarsheikh merged 3 commits intomasterfrom
59001-abrar-auto
Dec 2, 2025
Merged

[Serve] set last scale up/down time on autoscaling context#59057
abrarsheikh merged 3 commits intomasterfrom
59001-abrar-auto

Conversation

@abrarsheikh
Copy link
Contributor

fixes #59001

Signed-off-by: abrar <abrar@anyscale.com>
@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label Nov 28, 2025
@abrarsheikh abrarsheikh marked this pull request as ready for review December 1, 2025 18:47
@abrarsheikh abrarsheikh requested a review from a team as a code owner December 1, 2025 18:47
)

# Record the scaling event timestamp
self._autoscaling_state_manager.record_scaling_event(self._id, new_num, old_num)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Scaling event timestamp not recorded on early return

The record_scaling_event call is placed after an early return condition (lines 2340-2346). When is_within_bounds() returns False, the function returns True at line 2346 without ever calling record_scaling_event(), even though the target state was already changed at line 2336. This means scaling event timestamps won't be recorded when a deployment has running replicas outside its autoscaling bounds, causing last_scale_up_time and last_scale_down_time to be stale or None in subsequent autoscaling decisions.

Fix in Cursor Fix in Web

@ray-gardener ray-gardener bot added the serve Ray Serve Related Issue label Dec 1, 2025
Copy link
Contributor

@harshit-anyscale harshit-anyscale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments, else LGTM!

Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
@abrarsheikh abrarsheikh merged commit c9aa1b3 into master Dec 2, 2025
6 checks passed
@abrarsheikh abrarsheikh deleted the 59001-abrar-auto branch December 2, 2025 20:10
peterxcli pushed a commit to peterxcli/ray that referenced this pull request Feb 25, 2026
…ct#59057)

fixes ray-project#59001

---------

Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Serve][Autoscaling] Last scale-up and scale-down time not given for application level autoscaling policy

3 participants