R
Railway•15mo ago
shehbaj

How to keep old deployment active if it still has an on going task?

Hi Railway.app Team, I'm currently facing an issue on the platform related to the handling of ongoing tasks during deployments. Here's the problem: When I push a new version of my code to production, the existing container, even if it's in the middle of an ongoing task, gets replaced by the new deployment without allowing the task to complete. This is causing significant disruptions to my application's functionality and reliability. How do I make sure that ongoing tasks are allowed to finish before the old container is replaced? Can you please guide me on how to achieve this or if there are any specific settings or configurations I should use? This issue is impacting the user experience on my application. Thank you for your help, Shehbaj
6 Replies
Percy
Percy•15mo ago
Project ID: N/A
Brody
Brody•15mo ago
unfortunately theres really no way to change that behaviour, your app gets a 3 second grace period before it's force killed, though I can see how that would disrupt long running requests, so ill tag in a team member monday and maybe they will have some ideas on what you can do to minimise downtime
shehbaj
shehbajOP•15mo ago
To add more context, I am processing videos using FFMPEG and a bunch of third party APIs in a dockerized Golang backend. Due limited compute resource and third party API rate limiting, I have implemented worker queues and hence most of the tasks take ~15 minutes, so for now I have to refrain from pushing a new version if there are any active processing tasks running.
Brody
Brody•15mo ago
@Ray - could I have your assistance with this one?
Ray
Ray•15mo ago
This is correct. How long do your running processes take to exit? Does your task queue pick up from where it left off (restarting killed jobs upon a fresh deploy)?
Brody
Brody•15mo ago
wrong reply 🤣 so I'll tag @Shehbaj Dhillon for viability
Want results from more Discord servers?
Add your server