Skip to content

fix(people): keep synchronous governed reads off the ASGI event loop #320

Open

Description

@seonghobae

Verified canonical owner defect

Canonical governed People-read owner PR #55 exact 6cf99537d4b5924a9b188ef9d00c980f0024b0e4 executes synchronous read_worker_people_record(...) directly inside PeopleAsgiApp.__call__.

The governed PostgreSQL read port is synchronous DB-API work (connection/cursor/execute/fetch). Running that service call on the ASGI event-loop thread can stall unrelated concurrent requests while database I/O blocks. The same defect was independently exposed in Position-history #154 and Employment-history #155; this issue owns the canonical People root repair rather than copying leaf fixes upstream.

Required RED -> GREEN

  1. Add an owner-level HTTP regression that records the protected People read-port thread and requires it to differ from the ASGI event-loop thread.
  2. The predecessor exact source must fail that contract because the service call executes directly in the coroutine.
  3. Apply the minimum causal repair at fix(people): harden governed People reads #55: keep the synchronous application/persistence contract but offload the complete read_worker_people_record(...) call through an async worker boundary such as asyncio.to_thread(...).
  4. Preserve current 403/404/409/500 exception mapping and purpose-bound authorization semantics; worker exceptions must propagate through the await boundary.
  5. Do not open a long-running PostgreSQL transaction around authentication or unrelated work. The existing short read transaction remains owned by the PostgreSQL port.
  6. This repair is availability/event-loop isolation only. It is not p95 <=20 ms evidence; issue people-api: wire governed telemetry and prove buyer-path p95 <= 20 ms #257 continues to own production-equivalent buyer-path measurement and telemetry.
  7. After fix(people): harden governed People reads #55 moves, descendants must ordinary non-force adopt the canonical owner delta. No force push, destructive rebase, mutable source copy, predecessor-GREEN transfer, or gate weakening.

Keep open until the owner repair reaches protected truth with exact-head Foundation/security/review evidence.

Activity

  1. seonghobae commented on Sep 14, 2026

    @seonghobae
    ContributorAuthor

    Owner repair is now on #55. Test-first e1b23b2ad08cb4a1c53adbf1002d6204f37871cc adds the regression requiring the governed read port to run off the ASGI event-loop thread. Causal source d9803ae86fbc63bb41197c55d071dbba033361e8 awaits asyncio.to_thread(read_worker_people_record, ...) and preserves existing exception mapping/short PostgreSQL transaction ownership. The test-only hosted runs were cancelled when superseded; current exact-head Foundation 34822030870, CodeQL 34822030874, Security 34822030884, and SAST 34822030815 are newly queued, so no hosted GREEN is claimed. Employment descendants ordinary non-force adopted the owner delta (#149 afafd9b... → #155 28a0993... → #156 b0c8dcf...). Keep issue open until protected integration.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions