Skip to content

Time out hung backend requests so the retry can take over - #136

Merged
joreilly merged 1 commit into
mainfrom
http-timeout-retry
Oct 18, 2026
Merged

joreilly merged 1 commit into
mainfrom
http-timeout-retry

Conversation

@joreilly

Copy link
Copy Markdown
Owner

Summary

  • The flake: the iOS Maestro flow sometimes fails waiting for the route list. The maestro-debug-ios screenshot from Override the wasm lock's ws to 8.22.0 #135's first run shows the Routes screen still spinning after the 30s wait. The backend and route data were fine (routes.json in about 0.1s), and iOS CI on main passes
  • The cause: the shared HttpClient has no timeout. getRoutes() already goes through retrying (3 attempts), but a request that hangs never fails, for example on a Cloud Run cold start. It waits out the platform default, 60s on iOS, before the retry can start
  • The fix:
    • install(HttpTimeout) { requestTimeoutMillis = 20_000; connectTimeoutMillis = 10_000 }. Every response is small: routes.json is 555 B, stops.json 74 KB and a route about 44 KB, all under 0.2s warm. The live bus.json is about 4s, so 20s leaves headroom
    • the flow's route-list wait goes from 30s to 60s, enough for a cold start plus one timed-out retry
  • Tests inject their own HttpClient, so they're unaffected

Test plan

  • :shared:jvmTest and :shared:iosSimulatorArm64Test (119 tests) pass, and the Android, iOS (compileKotlinIosArm64) and wasm builds succeed
  • CI green, including the iOS and Android Maestro flows

🤖 Generated with Claude Code

https://claude.ai/code/session_012JqiL2Tbg2oz8bvJYsmpxH

The HTTP client had no timeout, so a request hanging on a Cloud Run cold
start waited for the platform default (60s on iOS) before `retrying` could try
again. The iOS Maestro flow then saw the Routes spinner for its whole 30s wait
and failed. Add a 20s request / 10s connect timeout (responses are small and
normally sub-second; the live bus feed ~4s), and give the flow's route-list
wait 60s to cover a cold start plus one retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012JqiL2Tbg2oz8bvJYsmpxH
@joreilly
joreilly merged commit aaf079a into main Oct 18, 2026
4 of 5 checks passed
@joreilly
joreilly deleted the http-timeout-retry branch October 18, 2026 13:48
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.

1 participant