Heavy queries hanging
I've refactored my convex code and am now working on some queries that take a lot longer than they used to (my own fault, and expected). Generally they hit the 1s limit and report as such in the logs. But I'm working on one now that clearly hangs all queries but never reports in the logs. As far as I can tell, it hangs for a while, and eventually (maybe 30-60s later) active queries rerun, but if I navigate through the app, queries aren't working once I've sent off this heavier query.
It's almost like the instance crashes and reboots maybe?
7 Replies
I mean its serverless so probably not "reboot", but it never reports back and the other queries update together in line with some kind of reset
I can check the metrics for your deployment to see if there is interesting happening. What is your deployment name?
Also when this "hangs all queries but never reports in the logs" is all queries for the service or just queries for the client that issued the heavy query?
just dm'd deployment name
not sure how to answer your question - the query is initiated by the client if that's what you're asking
I mean, does the slow query affect the client that issued the query (perhaps the slow query takes a while to execute, and all other queries for the same client are blocked) OR does it affect all clients even ones that didn't issue the heavy query (that would suggest some wider service issue)? I would guess is the former?
Ah I see - I only have one client running right now (local, native)
I'm still perplexed by the hanging and never sending logs thing, but I have a path forward for doing this particular computation in advance and paginating the query, so I'm alright with letting this go for now.
Thanks for your help
We just introduced getting more granular timing data in functions with
console.time()
in convex 1.9. This allows you to see how long things take within a query. release notes: https://news.convex.dev/announcing-convex-1-9/Convex News
Announcing Convex 1.9
Big Import and Export Improvements
When we released ZIP file imports and exports in Convex 1.7, it wasn't long before industrious developers started hitting the limitations. We’ve got some big improvements for you.
* File storage can now be included in Snapshot Export
* Snapshot import via npx convex import
oh awesome!!