Task queue order when deploying to multiple tenants

Commonly when deploying we will deploy to multiple tenants at once. It is quite common for us to deploy all and have 50 more tenants all queued up at a time.

When you navigate to the tasks page to view the running and queued tasks it appears that all tasks queued in that same batch are displayed in alphabetical order upon Tenant Name. However they then appear to execute in a random order, I am assuming it is instead based upon TenantId. This makes it quite tricky to monitor what is actually happening given that multiple tasks can be running at once and they can be on different pages.

I don’t mind what order they execute in however it would be nice if the task list was sorted in this same order.

1 Like

How do you create the deployments? Mass create with the UI? From command line?

If from command line, just write a loop around it and go through all the tenants in an order you’d prefer to see in. Take an extra 3 seconds of execution time at start but they’ll show up in order when viewed then.

Sorry I should have been more specific.
I am referring to a deployment via the new GUI and selecting multiple tenants prior to hitting the deploy button.
I believe this behaviour is consistent with the old UI as well.
In my case it isn’t worth switching the command line as I can work around it but on the other hand I would think that it would be a rather simple fix to have the task listing in consistent order with how the tasks actually execute.

Hi @mbotting,

Thanks for getting in touch.

The queue order of tenanted deployments created through the UI is indeterministic. A deployment is created for each tenant and the tasks shown on the tasks page are order by queue time.

I think what you are seeing is that some of your tenants have identical queue times and the task queue is processing them in a different order to how they are displayed on the tasks page. I’ve created an issue so that deployments will be executed in the same order that they are displayed: https://github.com/OctopusDeploy/Issues/issues/4317