Skip to content

perf: remove redundant readiness query - #303

Open
Linxiushen wants to merge 1 commit into
OpenHands:mainfrom
Linxiushen:perf/readiness-pre-ping
Open

perf: remove redundant readiness query#303
Linxiushen wants to merge 1 commit into
OpenHands:mainfrom
Linxiushen:perf/readiness-pre-ping

Conversation

@Linxiushen

Copy link
Copy Markdown
Contributor

Summary

  • rely on the engine's configured pool_pre_ping during readiness connection checkout
  • remove the handler's redundant second SELECT 1 database round-trip
  • tighten the readiness test double so it fails if the endpoint attempts to execute a query

The endpoint still acquires a database connection and preserves the existing 503 response for connection or pre-ping failures.

Testing

  • ruff check openhands/automation/app.py tests/test_health.py
  • ruff format --check openhands/automation/app.py tests/test_health.py
  • full endpoint tests were not available locally because LiteLLM 1.93's Windows build requires the MSVC linker; upstream Linux CI should run them

Fixes #287

Disclosure: This change was prepared with AI assistance. I reviewed the implementation and ran the checks listed above.

@github-actions github-actions Bot added the type: perf A performance improvement label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: perf A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/ready performs two database round-trips per probe, making it fragile under short probe timeouts

1 participant