Skip to content

Conversation

@mosche
Copy link
Contributor

@mosche mosche commented Mar 18, 2025

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

…h core pool size = 0 (elastic#124732)

When `ExecutorScalingQueue` rejects work to make the worker pool scale up while already being at max pool size (and a new worker consequently cannot be added), available workers might timeout just about at the same time as the task is then force queued by `ForceQueuePolicy`. This has caused starvation of work as observed for `masterService#updateTask` in elastic#124667 where max pool size 1 is used. This configuration is most likely to expose the bug.

This PR changes `EsExecutors.newScaling` to not use `ExecutorScalingQueue` if max pool size is 1 (and core pool size is 0). A regular `LinkedTransferQueue` works perfectly fine in this case.

If max pool size > 1, a probing approach is used to ensure the worker pool is adequately scaled to at least 1 worker after force queueing work in `ForceQueuePolicy`.

Fixes elastic#124667
Relates to elastic#18613

(cherry picked from commit 36874e8)

# Conflicts:
#	server/src/main/java/org/elasticsearch/threadpool/ScalingExecutorBuilder.java
#	test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java
@mosche mosche added :Core/Infra/Core Core issues without another label auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Mar 18, 2025
@elasticsearchmachine elasticsearchmachine merged commit dd4a892 into elastic:8.16 Mar 18, 2025
15 checks passed
@mosche mosche deleted the backport/8.16/pr-124732 branch March 18, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :Core/Infra/Core Core issues without another label v8.16.6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants