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

Deployments using multiple workers in a single Worker Pool acquire different workers when packages overlap or subsequent steps do not use packages. #8791

Closed
IsaacCalligeros95 opened this issue May 14, 2024 · 1 comment
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@IsaacCalligeros95
Copy link

IsaacCalligeros95 commented May 14, 2024

Severity

Low, Sev 3

Version

All

Latest Version

I could reproduce the problem in the latest build

What happened?

Our docs spell out how Worker Selection works. In reality it looks like there's quite a few discrepancies in the actual behaviour and some room for improvement. There's some comments in the RequiredPackageListBuilder that call this out

        // We want to try to ensure actions which require the same package run on the same worker, to minimize package transfers.
        // This is currently pretty naive. It ignores:
        // - package versions
        // - some packages won't be acquired
        // - it is only using the first package which will be acquired in the case of actions with multiple packages
        // But this isn't functionality we advertise publicly, and it should cover the majority of cases.

The simplest case here is a deployment process with one worker pool, two steps (Run a Script), where the first uses a package and the other is an inline script. Since the packageId is a part of the Worker Lease Key, the second step will require a new worker. We should be able to fine tune this logic.

These docs also call out Reference Packages and reference package ordering. The WorkerLeaseFactory GetOrLeasePackageWorker only takes a single PackageId, which is then used in the worker lease key. The key is just a concatenation of the WorkerPoolId and the PackageId. From this it appears that Reference packages are completely ignored in this process

Containers and Execution images are another area to look into.

Reproduction

  • Create a Worker Pool with 2 workers.
  • Create two steps Run a Script steps, the first will use a package reference and the second will be an Inline Script.
  • Depending on environment variables the project variables Octopus.Acquire.MaxParallelism and Octopus.Action.MaxParallelism may be required.
  • Deploy -> Two workers will be selected
    image

Error and Stacktrace

NA

More Information

No response

Workaround

No response

@IsaacCalligeros95 IsaacCalligeros95 added the kind/bug This issue represents a verified problem we are committed to solving label May 14, 2024
@Octobob
Copy link
Member

Octobob commented Sep 4, 2024

🎉 The fix for this issue has been released in:

Release stream Release
2024.3 2024.3.4888
2024.4+ all releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

2 participants