Skip to content

fix: update railway docs to include graceful shutdown#4715

Merged
NathanFlurry merged 1 commit intomainfrom
04-23-fix_update_railway_docs_to_include_graceful_shutdown
Apr 27, 2026
Merged

fix: update railway docs to include graceful shutdown#4715
NathanFlurry merged 1 commit intomainfrom
04-23-fix_update_railway_docs_to_include_graceful_shutdown

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@MasterPtato MasterPtato mentioned this pull request Apr 23, 2026
11 tasks
@claude
Copy link
Copy Markdown

claude Bot commented Apr 23, 2026

PR #4715 Review: fix: update railway docs to include graceful shutdown

Summary: This PR adds ~16 lines to website/src/content/docs/self-hosting/railway.mdx, documenting Railway's graceful shutdown configuration for Rivet Engine. It adds a new ## Graceful Shutdown section and a cross-reference to it from Step 2 of the manual deployment instructions.


Overall Assessment

The change addresses a real operational gap — Railway's default 0-second drain window can silently affect in-flight state on every deploy. The content is accurate in its high-level guidance, but there are several correctness, completeness, and style issues worth addressing before merge.


Issues

1. Incorrect environment variable name (potential bug)

The PR references RAILWAY_DEPLOYMENT_DRAINING_SECONDS and drainingSeconds in config-as-code. Railway's actual environment variable is RAILWAY_DEPLOYMENT_OVERLAP_SECONDS and the railway.toml key is overlapSeconds. The dashboard UI labels it "Draining Seconds" but the programmatic names differ. A wrong variable name will silently have no effect. Please verify against Railway's current docs before publishing.

2. PID 1 / signal-forwarding guidance is scoped to the wrong service

The npm start / yarn start examples make sense for user application containers (Step 3 of the guide), but this section is attached to deploying Rivet Engine (rivetdev/engine:latest). The engine image has its own entrypoint — users don't start it with npm start. The guidance should be explicitly scoped to the user's own application service, or it should verify and document whether rivetdev/engine:latest already handles signals correctly (similar to how the Render doc uses exec /usr/bin/rivet-engine start). Mixing the two concerns without clear scoping will cause confusion.

3. Step 2 cross-reference wording is misleading

Listing "Configure graceful shutdown" as a numbered deploy step implies it is required engine container configuration. But the graceful shutdown section documents a Railway service-level setting (drain window), not a container env var. Suggested wording: "Configure the Railway draining window for this service (see Graceful Shutdown below)."

4. Quick Deploy path skips graceful shutdown guidance entirely

Users who use the Quick Deploy buttons (Railway template / Rivet Starter) never reach the manual deployment section and never see this guidance. Consider adding a <Note> or <Warning> near the Quick Deploy section noting whether the Rivet Railway template already configures an appropriate drain window (or that users need to set it manually).

5. Trailing whitespace

There are trailing spaces at the end of the dumb-init / tini bullet line that should be removed.

6. Config-as-code example is missing

The sentence mentions three mechanisms (dashboard, config-as-code, env var) but only the variable name is code-formatted. A concrete railway.toml snippet would help users on the config-as-code path:

[deploy]
overlapSeconds = 60  # verify key name against Railway docs

Minor Suggestions

  • Rationale for 60 seconds. Noting what drives that number (e.g. typical actor state flush time, max in-flight request timeout) helps operators tune it for their workloads.
  • Audit Railway docs links. The linked anchors (#singleton-deploys, /deployment-teardown) should be verified as live — Railway has a history of restructuring their docs.
  • Production checklist gap. Since an unconfigured drain window can cause data loss on every deploy, this belongs as a bullet in the production checklist (/docs/self-hosting/production-checklist) alongside health checks and resource limits.

What the PR Gets Right

  • The core observation — Railway's 0-second default drain window can affect in-flight state — is accurate and important to document.
  • Cross-referencing the new section from Step 2 of the manual flow is the right structural choice.
  • The dumb-init/tini guidance is correct general advice for containerized workloads.

@MasterPtato MasterPtato force-pushed the 04-23-fix_add_wf_registry_command branch from dfd9202 to b4e1f50 Compare April 24, 2026 18:20
@MasterPtato MasterPtato force-pushed the 04-23-fix_update_railway_docs_to_include_graceful_shutdown branch 2 times, most recently from db7f54d to df97819 Compare April 24, 2026 23:02
@MasterPtato MasterPtato force-pushed the 04-23-fix_add_wf_registry_command branch from b4e1f50 to 39b3555 Compare April 24, 2026 23:02
@MasterPtato MasterPtato force-pushed the 04-23-fix_add_wf_registry_command branch from 39b3555 to 2daf067 Compare April 25, 2026 01:07
@MasterPtato MasterPtato force-pushed the 04-23-fix_update_railway_docs_to_include_graceful_shutdown branch from df97819 to 3ff43a4 Compare April 25, 2026 01:07
@MasterPtato MasterPtato force-pushed the 04-23-fix_add_wf_registry_command branch from 2daf067 to f8853a2 Compare April 25, 2026 01:14
@MasterPtato MasterPtato force-pushed the 04-23-fix_update_railway_docs_to_include_graceful_shutdown branch from 3ff43a4 to 0a19554 Compare April 25, 2026 01:14
@MasterPtato MasterPtato force-pushed the 04-23-fix_update_railway_docs_to_include_graceful_shutdown branch from 0a19554 to ac23ccc Compare April 27, 2026 18:04
@MasterPtato MasterPtato force-pushed the 04-23-fix_add_wf_registry_command branch from f8853a2 to 892fc6b Compare April 27, 2026 18:04
Base automatically changed from 04-23-fix_add_wf_registry_command to main April 27, 2026 20:38
@NathanFlurry NathanFlurry merged commit ac23ccc into main Apr 27, 2026
13 of 51 checks passed
@NathanFlurry NathanFlurry deleted the 04-23-fix_update_railway_docs_to_include_graceful_shutdown branch April 27, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants