Skip to content

[BUG] API call to RemoveFromPoolAsync allows targeting a negative number of Spot/Low-priority nodes #36847

Open
@jdoblams

Description

@jdoblams

Library name and version

Microsoft.Azure.Batch v15.4.0

Describe the bug

When we deallocate spot/low-priority nodes with the API call RemoveFromPoolAsync , the request is getting allowed to remove a node , even when the pool was steady with 0 nodes, this gave a result to resize to -1 from the Portal as it is visible in the next image

image

image

Expected behavior

We are looking to get some fix for the api request to avoid receive this kind of negative resizing request or perform some previous validation about the amount of nodes into the pool and avoid the same.
Since we use a validations over the low-priority nodes count this negative results are impacting in our applications.

As a workaround we are using Math.Max(0, pool.TargetLowPriorityComputeNodes) to handle this situation

Actual behavior

When we deallocate low-priority nodes with the API call RemoveFromPoolAsync , the request is getting allowed to remove a node , even when the pool was steady with 0 nodes, this gave a result to resize to -1 from the Portal as it is visible in the next image

image

image

Then at the end we receive the error of the resizing

image

Reproduction Steps

Batch pool with 0 nodes allocated
We execute the API call RemoveFromPoolAsync and the request is getting accepted
We observe this behavior into the Portal where the pool is scaling down to a negative number as the next image

image

Environment

Microsoft.Azure.Batch v15.4.0

Metadata

Metadata

Assignees

Labels

BatchClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions