Why does Railway send SIGTERM to old container before new container is switched?
makorism
HOBBYOP

2 months ago

I currently have a setup where I have a Wordpress site that I deploy to with docker. I inject a healthcheck.html page into my container once wordpress is all set up and this is what my Railway healthcheck calls.

In the brief period when the setup script is complete but before Railway has verified the new container as healthy, all requests just get a 502 error. Seemingly requests are routing to the old container that has apparently been killed by Railway before the new one is healthy.

If I wait a few seconds once this healthcheck has passed it correctly switches over to the new container. Is this a Railway problem or is it something I'm doing wrong?

I feel like Railway is just jumping the gun on the shutdown and should wait until the new one is healthy but I figured that was the default behaviour?

16 Replies

2 months ago

Do you have teardown enabled?


makorism
HOBBYOP

2 months ago

I didn't I just tried it but I'm still getting the problem


2 months ago

Deploy your service with teardown enabled, and then deploy again to see if it works


makorism
HOBBYOP

2 months ago

I have, still same issue, as soon as it gets to the healthcheck stage it 502s until it fully switches


2 months ago

Because you have a volume.


makorism
HOBBYOP

2 months ago

Ah right


makorism
HOBBYOP

2 months ago

okay so I'll just have to time my deployments to minimise my users getting 502 errors


2 months ago

Or move the storage layer to a bucket.


makorism
HOBBYOP

2 months ago

Like S3? Would that not be really slow, I never thought about it 🤔


makorism
HOBBYOP

2 months ago

Actually I only serve media from my volume so yes that makes sense let me try that 🙌🏿


2 months ago

Railway has buckets


2 months ago

(no markdown available for this content)


makorism
HOBBYOP

2 months ago

oh shit would you look at that


makorism
HOBBYOP

2 months ago

very nice I'll look into using that then


2 months ago

Depends on what you do, if it's media like you said, then no


2 months ago

Railway uses Tigris for buckets! And Tigris is fastttt


Welcome!

Sign in to your Railway account to join the conversation.

Loading...