Prevent pool to receive more than available processes on scaling #1096
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described in #897 a queue might currently scale down to 0 processes even though a minimum amount of processes per queue is configured.

I observed the behavior especially when one queue needs to process a lot of jobs over a longer period of time (
system_function
in the screenshot). In that case it sometimes receives all processes from other busy queues (low
in the screenshot) which leads to the other busy queue (low
) receiving 0 processes as all others are already busy even though theminProcesses
in the config is set to 3.To prevent this issue this pull request ensures that a queue will not receive more than the available processes when scaling up by considering the configured
minProcesses
and the amount of configured queues using the following formula:[maxProcesses] - (([amount of queues] - 1) * [minProcesses])
This ensures that every queue has the configured amount of
minProcesses
available.