-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query cancellation/timeout support #123
Comments
@haaawk I only implemented brute force canceling all ongoing operations. We still need to do timeouts, for example. |
How are we going to allow cancelation of a single queries @penberg? by making sure there's at most a single operation at each connection so that we can be sure that when we interrupt that connection we cancel a particular query? |
Here's the idea @levydsa @LucioFranco and me have about doing this (based on https://github.com/tursodatabase/libsql-js/blob/main/src/database.rs):
This way we make sure there's at most one cancellable query on the connection and we can safely interrupt it. |
@haaawk I am not sure I understand the proposal. How will you interrupt a query that is running within the SQLite VDBE? See the |
I still think (ab)using the progress handler is better here and just document the limitation that it only works for a single query at a time. |
I would implement it in https://github.com/tursodatabase/libsql-js/blob/main/src/database.rs in |
If a query takes a long time, applications may want to cancel them either manually or via a timeout mechanism. We should be able to use the
sqlite3_progress_handler()
to implement this where SQLite periodically checks if it's OK to keep running. We would have to track the execution time of individual queries.Depends on #122 for infrastructure on query timing.
The text was updated successfully, but these errors were encountered: