Skip to content

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

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

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