One deployment process task per worker

(Jon Vaughan) #1

Last week we put up node cap on both servers from 5 to 10. Now giving us a task cap of 20.

Around the same time, we have noticed a few Powershell issues that would suggest that Octopus workers are having multiple tasks running on then in parallel.

This was concluded yesterday when we had a Powershell script that created its own working directory and two deployments of the same project were kicked off into two separate environments at the same time.

They both ran on the same worker and we had a file clash in the working directory as one release was adding the files and another trying to remove them at the same time.

This isn’t the behaviour we want. How do we set up so one worker can only process one task?

In the meantime, I have dropped the cap count back down and modified the task to run in parallel. But this isn’t the behaviour that I wasn’t / was expected. I’m looking to have one worker runs one task.

How can I configure this, please?

(Kenneth Bates) #3

Hi Jon,

Thanks for getting in touch! When using the default working directories, we have safeguards in place to prevent these file clashes, though in your case when creating your own working directories I can see a couple of options.

  1. Use the environment variable (#{Octopus.Environment.Name}) as part of the working directory created in your script to ensure this kind of collision doesn’t happen.

  2. Set the task cap to match exactly your worker count.

Do either of those options get this working as intended/required? Let me know what you think or if you have any further questions or concerns going forward. :slight_smile:

Best regards,


(Jon Vaughan) #4

Hey Kenny,

Point 1.)
The clashing working directory was just down to our bad code and has been addressed, but it highlighted a misconception that we have held that it was one task, one worker.

Point 2.)
Will setting the task cap to match our worker count solve the problem? our workers are divided as follows:
lower environments (6 workers)
upper environments (4 workers)

Let’s say we have 6 tasks running in our lower environments and a task cap of 10. A new project is deployed into the lower environments, we are still under the task cap of 10, so it will run on one of the workers that are currently already running another task? causing use the parallel issue we are looking to avoid?


(Jon Vaughan) #5

Hi Octopus,

Do you have anything to control 1 task 1 worker?

I have seen now and again when running a deployment/health check/tentacle upgrade that Octopus says that it’s waiting for a task to finishes before the current one starts. So it feels like there is something there.