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

Don't require exclusive transactions for entire SQLite DB #132

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

RealOrangeOne
Copy link
Owner

When reading tasks from the task queue, the connection must be exclusive to ensure a task isn't picked up by multiple workers. However, no other queries need this exclusive lock. By removing the requirement for a completely EXCLUSIVE database connection, it should drastically improve the throughput of the rest of the application. All whilst not impacting correctness of the worker at all.

Where needed, queries are run in an exclusive transaction. The rest don't need to be, which hopefully improves throughput and prevents lock contention
@RealOrangeOne RealOrangeOne marked this pull request as ready for review February 3, 2025 22:46
@RealOrangeOne RealOrangeOne added the database-backend Issues relating to the database backend label Feb 3, 2025
@RealOrangeOne RealOrangeOne merged commit c84d060 into master Feb 4, 2025
48 checks passed
@RealOrangeOne RealOrangeOne deleted the sqlite-non-exclusive-transaction branch February 4, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-backend Issues relating to the database backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant