Closed min-mwei closed 2 months ago
@min-mwei I've seen this same issue come up elsewhere too - may I know the use case for closing the connection explicitly as you did here? The current approach in the Python client is to follow DuckDB's approach, where explicitly closing the connection is not necessary.
I can reproduce this on Ubuntu 22.04 locally. It seems to cause a Segmentation fault
. I will look into it.
@prrao87 the use case is to run kuzu on the "server side", assume closing the connection is one way to reuse resources especially there are "close API" for both Connection and Database
I think the issue is related to the query result deletion.
QueryResult is stored in a factorizedTable whose memory is managed by the bufferManager(database component).
If we destroy the database before deleting the query result, Segmentation fault.
occurs when python deletes the queryResult.
The simplest work around is to always delete queryResults before deleting conneciton and database.
simply add del ret
before the
conn.close()
db.close()
call
I think the issue is related to the query result deletion. QueryResult is stored in a factorizedTable whose memory is managed by the bufferManager(database component). If we destroy the database before deleting the query result,
Segmentation fault.
occurs when python deletes the queryResult. The simplest work around is to always delete queryResults before deleting conneciton and database. simply adddel ret
before theconn.close() db.close()
call
@min-mwei, we also have a QueryResult.close()
method: https://kuzudb.com/api-docs/python/kuzu.html#QueryResult.close
Calling ret.close()
before closing the connection and database should fix it. It is a bit safer than deleting ret
.
Kùzu version
v0.4.2
What operating system are you using?
Ubuntu 22.04
What happened?
The following code would crash the process when close is called.
Are there known steps to reproduce?
No response