Skip to content

Patch admin cost page so it no longer blocks other API calls#231

Open
mpkrass7 wants to merge 4 commits into
databricks-solutions:mainfrom
mpkrass7:marshall/patch_cost_router
Open

Patch admin cost page so it no longer blocks other API calls#231
mpkrass7 wants to merge 4 commits into
databricks-solutions:mainfrom
mpkrass7:marshall/patch_cost_router

Conversation

@mpkrass7

@mpkrass7 mpkrass7 commented Jun 17, 2026

Copy link
Copy Markdown

Addresses #229

https://databricks.slack.com/archives/C0AK9GCFQMV/p1781706581725879
image

TL/DR there's a bunch of async routes defined for not async in the cost tab. When you define a function as async and run it, you effectively tell fastapi to run the function until it hits an await step. Then it can hand it off. Since there aren't await steps in the longer running functions, we run into this big blocking issue that makes nothing else load when you leave the tab. And you will leave the tab by the way, because these queries take a long time to run.

The claudes tell me the simple fix is to just get rid of the async defs and let fastapi figure it out in its own threadpool.
See the tldr page here: https://fastapi.tiangolo.com/async/

top spenders gets to stay defined with async since it actually does some async operations already

Network activity after fix

image

@mpkrass7 mpkrass7 force-pushed the marshall/patch_cost_router branch from 41eb73a to ef18fd7 Compare June 17, 2026 18:07
@mpkrass7

mpkrass7 commented Jun 17, 2026

Copy link
Copy Markdown
Author

Adding in:

  1. Longer time to live on the cache for queries that have a long execution time
  2. Make the long running queries execute at app startup so users are more likely to hit the cache visiting the cost page

@mpkrass7 mpkrass7 changed the title Patch cost stuff so that it no longer blocks everything Patch admin cost page so it no longer blocks other API calls Jun 18, 2026
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