Skip to content
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

Start one background worker on first DuckDB query #544

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Y--
Copy link
Collaborator

@Y-- Y-- commented Jan 16, 2025

Up until now, we were starting the background worker as part of the extension.

The problem with this approach is that it imposes a unique worker, and thus cannot updated multiple database.

In preparation to have one BGW per database, this PR triggers the start of a background worker when IsExtensionRegistered is called and the cache is populated.

We've prevented potential race conditions that would cause two bgw to start by checking a lock on a temporary file.

Note: a following PR will actually start one BGW per database

@Y-- Y-- force-pushed the yl/md-bgw-per-db branch from a16675b to 2b13b4c Compare January 17, 2025 09:26
@Y-- Y-- force-pushed the yl/md-bgw-per-db branch from 2b13b4c to 9afec02 Compare January 17, 2025 09:30
@Y-- Y-- force-pushed the yl/md-bgw-per-db branch from 4c84f96 to 865c10b Compare January 17, 2025 10:08
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