Need clarification on the relationship between OVERLAP_SECONDS and DRAINING_SECONDS variables
okarmazin
PROOP

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

  • d2 is spun up and healthy

  • All new incoming traffic is now routed to d2

  • d1 will live for OVERLAP_SECONDS, but will never receive any new traffic again assuming all goes well

  • After OVERLAP_SECONDS, SIGTERM is sent to d1 and it now has further DRAINING_SECONDS for graceful shutdown.

  • If d1 wants to invoke itself (e.g. if a cron job is triggered) during OVERLAP_SECONDS or DRAINING_SECONDS, it can do so with a HTTP request to the public URL and the request will already be routed to d2, 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).

Solved

7 Replies

okarmazin
PROOP

a year ago

N/A


a year ago

you got everything correct, what else did you need clarification on?


okarmazin
PROOP

a year ago

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.


okarmazin
PROOP

a year ago

Otherwise, no further questions on this!


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 about 1 year ago


Loading...