Skip to content

[Bug]: Authorization policy lookup uses a background-task timeout profile on the synchronous request path #190

Description

@behzad-taghipour-hs

Description

A per-request authorization check reads role-based access policies from a database lookup as part of every query's processing. That lookup was configured with a timeout/retry profile meant for background or asynchronous work — a long timeout with multiple retries — even though it sits directly in the synchronous path every request has to pass through. Under any slowness or transient issue on that lookup, a single request could consume a large chunk of, or exceed, the entire request's time budget on this one step alone, well before ever reaching the actual query.

Environment

  • Commit ID: 42b5c6b (v0.2.2)
  • Environment: prod

Step to reproduce

  • Introduce latency or transient unavailability on the database backing the authorization policy lookup
  • Run any query that goes through the standard authorization check
  • Observe the request's time budget consumed disproportionately by the policy lookup step, independent of the actual query's own performance

A root cause

The client used for this lookup was constructed with a general-purpose, background-task timeout/retry configuration (long timeout, multiple retries) instead of a fail-fast configuration meant for steps directly on the customer-facing request path. The codebase already has a dedicated fail-fast configuration for exactly this kind of synchronous, latency-sensitive call; this lookup was never switched to use it.

Context

The system distinguishes background/ingestion-style database calls (tolerant of slower dependencies) from customer-facing, synchronous calls (expected to fail fast so a hung dependency can't tie up request capacity). This authorization lookup sits on the synchronous side but was wired with the background-side profile.

Risks & Known Unknowns

  • This was not the cause of the specific incident under investigation, but is a latent risk that could independently exhaust a request's time budget under database slowness.
  • Any other synchronous-path lookup using the same general-purpose client construction should be audited for the same mismatch.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions