-
Notifications
You must be signed in to change notification settings - Fork 5
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
bug close-db twice. #21
Comments
Small update. |
The REPL is disconnected because the process crashes - double free in C is often a crash-level bug leading immediately to segfaults. The connection still works because it has a shared pointer to the database - you need to close both the database and the connection to terminate the duckdb instance under the covers. I am not certain this points to any real issue. What solutions do you expect from this? |
Connection part makes sense thanks for explaining. Running close-db twice and getting disconnect from REPL still seem like unexpected behaviour. If you think otherwise, feel free to close. |
I think it isn't fixable at the lowest level as dt-ffi pointers are immutable - but I think perhaps the opendb and open-connection pathways could return java.lang.AutoCloseable objects that could themselves have mutable ptr fields and would - as is common throughout java - quietly ignore or perhaps just warn on double close. Are you interested doing this work in a PR? |
I'm currently away for next 2 days. When I'm back I'll have a look at it. |
Sounds great - here are a quick time savers for when you get back. There is a protocol used to get the actual pointer from the object passed in - this allows a generic deftype to behave like a pointer and then you can overload various things such as adding closeable and potentially overriding toString. |
I discovered strange behaviour with 'close-db'. I'm using latest version '0.8.1-13'
I'm on WSL2 and VSCode with Calva.
I attached example code below with tutorial from readme and doing close-db twice.
Many thanks for TMD <3
The text was updated successfully, but these errors were encountered: