a year ago
Hello, the documentation on https://docs.railway.com/reference/deployments#deployment-states and https://docs.railway.com/reference/deployments#singleton-deploys is not clear to me.
Here's how I understand it, please correct any inaccurate statements:
Let d1 and d2 be the old and new deployments of a service. The deployment goes as follows.
Assuming healthchecks are st up
d2is spun up and healthyAll new incoming traffic is now routed to
d2d1will live forOVERLAP_SECONDS, but will never receive any new traffic again assuming all goes wellAfter
OVERLAP_SECONDS,SIGTERMis sent tod1and it now has furtherDRAINING_SECONDSfor graceful shutdown.If
d1wants to invoke itself (e.g. if a cron job is triggered) duringOVERLAP_SECONDSorDRAINING_SECONDS, it can do so with a HTTP request to the public URL and the request will already be routed tod2, ensuring continuity
Why I need the clarification is that I have a bunch of runtime cron jobs, one of them can take up to 2 minutes to complete. I don't want it to be killed mid-job upon new deployment. Configuring a large-enough OVERLAP_SECONDS should solve this, since the cron job perfoms the actual work by calling an endpoint using the service's public URL (my last bullet point).
7 Replies
a year ago
you got everything correct, what else did you need clarification on?
Thanks for the confirmation. I can only suggest that the documentation itself be clarified. For example the Removed state documentation talks about "OVERLAP_SECONDS until it is removed", but it doesn't describe the actual process of removal. One can only deduce the process after scrolling all the way to the bottom and reading "Singleton Deploys". If you move "Singleton Deploys" directly below "Removed" state, it will be clearer and easier to grasp.
a year ago
im happy to review a PR if you're up for it!
a year ago
but for now, ill mark this as sovled
a year ago
!s
Status changed to Solved brody • 11 months ago