Skip to content

Use recursive mutex to deal with GIL <-> internal lock deadlocks#462

Open
evertlammerts wants to merge 1 commit into
duckdb:v1.5-variegatafrom
evertlammerts:fix_435_456
Open

Use recursive mutex to deal with GIL <-> internal lock deadlocks#462
evertlammerts wants to merge 1 commit into
duckdb:v1.5-variegatafrom
evertlammerts:fix_435_456

Conversation

@evertlammerts
Copy link
Copy Markdown
Member

Related to #435 and #456

#435 tries to use the same connection across multiple threads, which is not supported. Specifically, in this case the result is overwritten and destroyed concurrently, causing a segfault. This PR fixes the segfault by synchronising access to the result with a recursive mutex. But note that connections cannot be used across threads, no matter what.

#456: we sometimes need to destruct python-managed objects after releasing the GIL. This PR makes sure that we hold on to the GIL during the destruction of PyRelation and Connection::Close(). Note: I rely on CI to check whether the fix actually works here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant