What happens when you deploy a service that is already mid-deploy?

Hi folks - we deploy a nomad service at the end of our CI/CD pipeline. Currently, if two engineers merge into main within ~5 minutes of each other, it’s possible their deploys will step on each others toes. That’s to say, the first deploy will start, but before that deploy is finished, the next deploy of the same service will start. Is there any documentation on what is the expected behavior in these situations? We are using levant to deploy. Any insight is appreciated! Thank you.

I received this helpful response in the Gitter channel:

“At t=0, when you have done the initial deployment. An allocation goes in “pending” state. The scheduler then schedules them on an appropriate node, marking the alloc as “running” if successful.
But in your imaginary scenario let’s say the alloc stays at “Pending” for some more time. At t=1, another deployment happens. It’ll mark the old allocation as “Complete” since new one arrived. The new one will go through the same stage of Pending->Running this time.”

If you have any more insight, feel free to add!