Skip to content

Async query service client#2090

Merged
shangyian merged 11 commits into
DataJunction:mainfrom
shangyian:async-query-service-client
May 8, 2026
Merged

Async query service client#2090
shangyian merged 11 commits into
DataJunction:mainfrom
shangyian:async-query-service-client

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented May 5, 2026

Summary

This PR converts the query service client's methods from blocking requests.Session calls to httpx.AsyncClient. This way, DJ server's API endpoints that rely on the query service (e.g., /data/) won't block the event loop on warehouse-side query work.

These FastAPI routes are async def, but requests.post is sync, so query service calls like submit_query (and others) will hold the worker's event loop for the duration of the warehouse call. Other requests on the same worker can't make progress during that window. Swapping to httpx.AsyncClient lets the loop service other requests while the warehouse call is in flight.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit d52b2c0
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69fbd0a941b5830008359b60

@shangyian shangyian force-pushed the async-query-service-client branch from 7825165 to ae05bd3 Compare May 5, 2026 21:55
@shangyian shangyian force-pushed the async-query-service-client branch from b2eba01 to d52b2c0 Compare May 6, 2026 23:37
@shangyian shangyian marked this pull request as ready for review May 8, 2026 20:25
@shangyian shangyian merged commit b9033f6 into DataJunction:main May 8, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant