Skip to content

Make GraphQL HTTP timeout configurable via RAILWAY_HTTP_TIMEOUT#932

Merged
JakeCooper merged 2 commits into
masterfrom
cooper/configurable-http-timeout
Jun 4, 2026
Merged

Make GraphQL HTTP timeout configurable via RAILWAY_HTTP_TIMEOUT#932
JakeCooper merged 2 commits into
masterfrom
cooper/configurable-http-timeout

Conversation

@JakeCooper
Copy link
Copy Markdown
Contributor

Problem

The GraphQL client uses a hardcoded 30s timeout for every request (src/client.rs), with no flag, env var, or config to extend it. Long-running mutations — notably railway environment new <name> --duplicate <source> for a multi-service environment with volumes — intermittently exceed 30s and abort with operation timed out.

Reported in #923 and seen by multiple users on the support thread.

Change

  • Raise the default request timeout from 30s → 90s.
  • Allow overriding it with the RAILWAY_HTTP_TIMEOUT env var (in seconds), e.g. RAILWAY_HTTP_TIMEOUT=300.
  • Invalid values (0, negative, non-numeric, decimal, empty) emit a warning on stderr and fall back to the default rather than being silently ignored.

Tests

Added unit tests for the parsing helper (default / valid override / invalid fallback). Full client test module passes; cargo build is clean.

Out of scope

This reduces how often the timeout fires but does not make --duplicate atomic — a partial failure can still orphan an empty environment ("husk"). That's the deeper fix called out in #923 and should be tracked separately.

Closes #923

🤖 Generated with Claude Code

The CLI's GraphQL client used a hardcoded 30s timeout for every request,
with no escape hatch. Long-running mutations — notably
`environment new --duplicate` for a multi-service environment with volumes —
intermittently exceed 30s and abort with "operation timed out".

Raise the default to 90s and allow overriding it with the
RAILWAY_HTTP_TIMEOUT env var (in seconds). Invalid values are surfaced as
a warning and fall back to the default rather than being silently ignored.

Note: this reduces how often the timeout fires but does not make
`--duplicate` atomic; a partial failure can still orphan an empty
environment. That fix is tracked separately.

Closes #923

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JakeCooper JakeCooper added the release/patch Author patch release label Jun 4, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JakeCooper JakeCooper merged commit 8ae68d8 into master Jun 4, 2026
6 checks passed
@JakeCooper JakeCooper deleted the cooper/configurable-http-timeout branch June 4, 2026 03:30
codyde added a commit that referenced this pull request Jun 4, 2026
…-browser-login

* origin/master: (28 commits)
  chore: Release railwayapp version 5.0.0
  feat(sandbox): fork, templates, and `--variable`/`--env-file` on create (#933)
  chore: Release railwayapp version 4.68.0
  feat(volume): include modified time in files JSON (#931)
  chore: Release railwayapp version 4.67.0
  Add service source connection support (#934)
  chore: Release railwayapp version 4.66.2
  Make GraphQL HTTP timeout configurable via RAILWAY_HTTP_TIMEOUT (#932)
  chore: Release railwayapp version 4.66.1
  feat(volume): show status and scheduled deletion date in volume list (#928)
  SSH Command: Handle Identity Files (#926)
  chore: Release railwayapp version 4.66.0
  feat(sandbox): `railway sandbox` commands (create/list/ssh/exec/destroy) (#925)
  chore: Release railwayapp version 4.65.0
  SSH Agent Support, `russh` edition. (#915)
  chore: Release railwayapp version 4.64.0
  chore: Release railwayapp version 4.63.0
  Rephrase agent advisory and gate by CLI version (#919)
  Forward --remote to setup agent in cli.new installer (#918)
  chore: Release railwayapp version 4.62.0
  ...

# Conflicts:
#	src/consts.rs
#	src/util/mod.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Author patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

railway environment new --duplicate leaves an orphaned empty environment when duplication exceeds the hardcoded 30s client timeout

1 participant