Skip to content

fix(pr_v2): httpx client fd leak in 5 remaining PR endpoints #581

@frankbria

Description

@frankbria

Problem

get_pr_status was fixed in PR #580 to use try/finally: await client.close(), but five other endpoints in codeframe/ui/routers/pr_v2.py still allocate an httpx.AsyncClient on every request and never close it:

  • list_pull_requests (~line 250)
  • get_pull_request (~line 290)
  • create_pull_request (~line 333)
  • merge_pull_request (~line 380)
  • close_pull_request (~line 431)

Under load these will accumulate open sockets/file descriptors.

Fix

Apply the same try/finally: await client.close() pattern to each of the five endpoints. The pattern is already established in get_pr_status.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions