Skip to content

incorrect logic around MaxVirtualMachines #23

@travisghansen

Description

@travisghansen

Bug report

There are incorrect assumptions that lead to VMs never launching.

Describe the bug

A basic assumption that the code is currently making is that never more than 2 pods will be scheduled for a node at a time. This is a bad assumption and in certain cases results in VMs/Pods never launching.

To Reproduce

Steps to reproduce the behavior:

Create 5 Pods each simultaneously explicitly setting nodeName to a relevant node.

Expected behavior

5 Pods are created. 2 Pods start running and as soon as 1 of them exits 1 of the 3 remaining Pods will start and so on until all of them have executed.

Current Behavior

The first 2 Pods will launch. Internally the atomic counter gets set to 5 as the counter tracks 'stored' VM configs not running VMs. The first 2 pods will come to completion decrementing the counter to 4 and then 3. 3 is not <= MaxVirtualMachines and therefore none of the remaining Pods will start unless 1 of the is deleted from the k8s api without ever running.

The breakdown in the logic is based on the idea that it is never possible for the k8s api to have more than 2 simultaneous Pods scheduled for a target macos node.

I have a fix I am testing now where I simply have added a 2nd counter property that keeps track of VMs running. I will submit a PR after some testing but wondering if you have any input about another way to fix the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions