What is the max permitted value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS?
nolanholden
HOBBYOP

2 years ago

We have long-running (<5min) jobs that kick off from webhooks, which politely return HTTP responses right away, but keep processing.

So I want to catch SIGTERM and allow them to complete, then exit 0.

Solved

23 Replies

2 years ago

few hours


2 years ago

n/a


nolanholden
HOBBYOP

2 years ago

Thank you. 1hr is well more than enough.

I assume this will not change any time soon? (If so, a warning would be great)


2 years ago

I don't see why we would change it, a lot of customers use it


nolanholden
HOBBYOP

2 years ago

Fantastic. Thanks for the info.

One small feedback: this config was hard to find btw, b/c I was looking all over "deployments" and "zero downtime" but finally found it here: https://docs.railway.com/reference/variables


2 years ago

did you use the search bar?


nolanholden
HOBBYOP

2 years ago

I did. but my search terms (i think mainly "deployment" etc) weren't hitting that, at least i didn't notice


2 years ago

where else in the docs do you think it would be applicable to mention it?


nolanholden
HOBBYOP

2 years ago


2 years ago

I don't think the variable has much to do with zero downtime though?


2 years ago

your new service would have already come online regardless of that variable


nolanholden
HOBBYOP

2 years ago

A bit subtle I suppose.

For the semantics of my project, SIGTERMing a running container, even if there are no unresponded HTTP requests, or no open TCP sockets, means downtime. The long job could be cut in half.


nolanholden
HOBBYOP

2 years ago

I agree it's not exactly related


2 years ago

I'm just realizing I've mentioned the wrong variable here -


nolanholden
HOBBYOP

2 years ago

your new service would have already come online regardless of that variable

while this is true, in my case the new deployment would be completely unaware of the active job. (Note: it could be designed to, but that's a bit overkill in my case)


nolanholden
HOBBYOP

2 years ago

RAILWAY_DEPLOYMENT_DRAINING_SECONDS is not the one you mentioned?


2 years ago

it says overlap when it should be draining


nolanholden
HOBBYOP

2 years ago

I'm sorry, I'm confused.

Such as in this thread: https://discord.com/channels/713503345364697088/1290350655222841345/1290354036062818397

I see I can arbitrarily extend the life of the old deployment with RAILWAY_DEPLOYMENT_OVERLAP_SECONDS

but all I need (which I believe is exclusive in behavior to that one) is for the new deploy to come up as normal, but the old deploy to (possibly) hang on SIGTERM for a few minutes, to be decided by the old deploy app at runtime.


nolanholden
HOBBYOP

2 years ago

So i'd like to know the max time for both, I suppose


2 years ago

you want draining, the variable you asked about originally


2 years ago

I don't have an exact time, so I'm safely saying a few hours


nolanholden
HOBBYOP

2 years ago

Ok, great.


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...