Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing target base scale instance concurrency for queues #44661

Merged
merged 5 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

## 5.4.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed
- Rely on PeekMessagesAsync when calculating message queue length
- Fixing target base scale instance concurrency for queues
- Bumped version of Azure.Storage.Blobs to resolve issue where Blob Path was being truncated at '#' character.

### Other Changes

## 5.3.0 (2024-04-18)
- Includes all features from 5.3.0-beta.1.
- Bumped Azure.Identity dependency to 1.11.1 to resolve secruity vulnerability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public async Task<TargetScalerResult> GetScaleResultAsync(TargetScalerContext co

internal TargetScalerResult GetScaleResultInternal(TargetScalerContext context, int queueLength)
{
int concurrency = !context.InstanceConcurrency.HasValue ? _options.BatchSize : context.InstanceConcurrency.Value;
int concurrency = !context.InstanceConcurrency.HasValue ? _options.BatchSize + _options.NewBatchThreshold : context.InstanceConcurrency.Value;

if (concurrency < 0)
{
throw new ArgumentOutOfRangeException($"Concurrency value='{concurrency}' used for target based scale must be > 0");
throw new ArgumentOutOfRangeException($"Concurrency value='{concurrency}' used for target based scale must be > 0.");
}

int targetWorkerCount = (int)Math.Ceiling(queueLength / (decimal)concurrency);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

## 5.4.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed
- Rely on PeekMessagesAsync when calculating message queue length
- Fixing target base scale instance concurrency for queues
- When grabbing Queue Metrics for amount of messages, will now use the QueueTriggerMetrics.QueueLength instead of the ApproximateMessagesCount for less stale metrics.
### Other Changes

## 5.3.0 (2024-04-18)
- Includes all features from 5.3.0-beta.1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void Setup()
[TestCase(160, 20, 8)]
public void QueueTargetScaler_Returns_Expected(int queueLength, int? concurrency, int expectedTargetWorkerCount)
{
QueuesOptions options = new QueuesOptions { BatchSize = 16 };
QueuesOptions options = new QueuesOptions { BatchSize = 8, NewBatchThreshold = 8 };

TargetScalerContext context = new TargetScalerContext
{
Expand Down
Loading