-
Notifications
You must be signed in to change notification settings - Fork 132
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
Feature: Graceful stopping and reloading if connection to database is stopped midquery #5016
Comments
hi @DDoyle1066 Are you experiencing this in Python API? "terminate the process, I am unable to connect back to the database and the database just hangs" Do you mean the creation of Kuzu Database object hangs for you if you restart your process to connect to the same db directory? |
I have experienced it in both the python API and when running a query in kuzu explorer. The most recent case was that detaching and deleting nodes was taking a lot longer than I anticipated, I terminated the process to figure out how to do it faster and when I tried reconnecting with a fresh process running kuzu.Database("path/to/db") it just hung for a while. |
Yes, I agree. We should be able to stop gracefully and restart. This looks like a bug to me rather than a feature. We should look into this and get it fixed. Are you able to ship a reproducible example to us for debugging? That would help a lot! |
The same dataset from this issue will reproduce this. I loaded the dataset until 2022 (this can be done by changing line 413 to partition_name = '2022q4_notes'
conn.execute(f"MATCH (n:Num) where n.partition_name= '{partition_name}' DETACH DELETE n") Terminating the process midway gave me the error. Running it on a small set of data that does not take as long to load gives me this error in case that is helpful:
|
Hi @DDoyle1066 just a heads up we made some changes that hopefully help with this issue, they will be available in the next nightly build (or the coming release):
Edit: you need to busy loop in the main thread to give the interpreter opportunities to process signals Alternatively if you use the new
|
@royi-luo Thanks! I will check if out and let you know if I have any issues |
API
Python
Description
I am not sure if this comes under the heading of feature or bug. But one thing I have noticed (especially when running large queries) is that sometimes if I have written and tried to execute a query that is taking a long time and then I terminate the process, I am unable to connect back to the database and the database just hangs. I don't know what the cause of this is because sometimes when I terminate the process I am able to reconnect just fine; it is not clear how to fix the database to go back to a version that I can query from and I have to reload everything from scratch which is often time consuming.
The text was updated successfully, but these errors were encountered: