Skip to content

fix(gateway): close api server response store leak#36242

Open
zapabob wants to merge 5 commits into
NousResearch:mainfrom
zapabob:codex/fix-api-server-fd-leak-36111
Open

fix(gateway): close api server response store leak#36242
zapabob wants to merge 5 commits into
NousResearch:mainfrom
zapabob:codex/fix-api-server-fd-leak-36111

Conversation

@zapabob

@zapabob zapabob commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require API_SERVER_KEY before env-loading the api_server platform
  • report api_server as connected only when it has a configured key
  • close the ResponseStore SQLite connection on failed unauthenticated startup and adapter disconnect

Fixes #36111.

Test plan

  • uv run --extra dev ruff check gateway/config.py gateway/platforms/api_server.py tests/gateway/test_api_server.py
  • uv run --extra dev --extra messaging python -X utf8 -m pytest tests/gateway/test_api_server.py tests/gateway/test_api_server_bind_guard.py -q --timeout-method=thread (176 passed, 1 skipped)

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels Jun 1, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of open PR #36180, which fixes the same #36111 api_server ResponseStore SQLite FD leak (require API_SERVER_KEY to load platform, fix connected-checker, close ResponseStore on disconnect). Also overlaps #36116. Maintainers should consolidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File descriptor leak in api_server platform: ResponseStore SQLite connections not closed on retry

2 participants