Skip to content

Threaded healthcheck server + take db off the critical path#8

Open
mahmoud wants to merge 4 commits into
LaunchPlatform:masterfrom
mahmoud:healthcheck-reliability
Open

Threaded healthcheck server + take db off the critical path#8
mahmoud wants to merge 4 commits into
LaunchPlatform:masterfrom
mahmoud:healthcheck-reliability

Conversation

@mahmoud

@mahmoud mahmoud commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Fixing a longstanding nuisance in my production env: Render times out the healthcheck after only 5 seconds, and the basic server just can't keep up with that. Not sure if it's due to db variability or just jankiness of the non-threaded healthcheck server, so this PR addresses both. I just deployed this in my staging environment, so feel free to treat this as a draft for now while I let the reliability bake. :)

mahmoud and others added 2 commits February 26, 2026 12:46
- Combine _health_ok + _health_info into atomic _health_state tuple
  to prevent torn reads between HTTP handler and heartbeat threads
- Set health state to unhealthy during graceful shutdown
- Remove redundant _health_ok = False assignment
- Fix import ordering (alphabetical stdlib)
- Remove extra blank line before ThreadingWSGIServer
- Simplify test fixture: use real Config instead of mock.patch
- Remove stray files unrelated to healthcheck fix
@mahmoud

mahmoud commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Circling back, been running this in production for months now. The only times I've been alerted were when the queue worker was actually down (oom'd due to business logic :P )

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