Skip to content

AER-4645 Fix to update load metric also on a regular basis - #135

Merged
Hilbrand merged 3 commits into
aerius:mainfrom
Hilbrand:AER-4645-load-fix
Sep 15, 2026
Merged

Hilbrand merged 3 commits into
aerius:mainfrom
Hilbrand:AER-4645-load-fix

Conversation

@Hilbrand

@Hilbrand Hilbrand commented Sep 3, 2026

Copy link
Copy Markdown
Member

Current implementation only updated load when task dispatched or finished. With long running jobs this could mean it takes some time to update. But since load is used to scale it could be the load value triggered scaling, when scaled it would be expected the load to decrease (more workers for same work). But when load is not updated the load stays the same and system might still think it needs scaling up, and will scale up even more. With this change it will use the regular called update that was only used to track the initial state of the queue. It now uses a delta of 0 as there are no new number of messages. In the LoadMetric it will than only perform an update if the number of workers changed. In other situation there is no reason to update.

LoadMetric changed a bit because process computes the values at the moment called but it does that by calling with last known values and delta 0. But with new guard it would result in update not being performed. Therefore put update in separate method.

Removed dispatchedTasks from TaskManagerUsageMetricsProvider as it was to cover for tasks that were still on the queue when the taskmanager would be (re)started. But with startupGuard these messages are accounted for and therefore no need to filter those out is needed.

Current implementation only updated load when task dispatched or finished. With long running jobs this could mean it takes some time to update.
But since load is used to scale it could be the load value triggered scaling, when scaled it would be expected the load to decrease (more workers for same work).
But when load is not updated the load stays the same and system might still think it needs scaling up, and will scale up even more.
With this change it will use the regular called update that was only used to track the initial state of the queue.
It now uses a delta of 0 as there are no new number of messages. In the LoadMetric it will than only perform an update if the number of workers changed. In other situation there is no reason to update.

LoadMetric changed a bit because process computes the values at the moment called but it does that by calling with last known values and delta 0. But with new guard it would result in update not being performed. Therefore put update in separate method.

Removed dispatchedTasks from TaskManagerUsageMetricsProvider as it was to cover for tasks that were still on the queue when the taskmanager would be (re)started. But with startupGuard these messages are accounted for and therefore no need to filter those out is needed.

@tom-h42 tom-h42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some spelling in the test comments, and a question about the sequencing

@tom-h42 tom-h42 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Question answered, thanks

@Hilbrand
Hilbrand merged commit 01c0274 into aerius:main Sep 15, 2026
1 check passed
@Hilbrand
Hilbrand deleted the AER-4645-load-fix branch September 15, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants