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

[bugfix/workaround]replace modernc.org/sqlite-v1.29.5 with gitlab.com/NyaaaWhatsUpDoc/sqlite-v1.29.5-concurrency-workaround #2811

Conversation

NyaaaWhatsUpDoc
Copy link
Member

Description

See for changes: https://gitlab.com/NyaaaWhatsUpDoc/sqlite/-/commit/29a5812b7c37800d643eff7fc9686e61ad3112c8

This is a temporary fix for #2808 and #2774. This works by cutting out the possible concurrent access of a singullar sqlite3 db pointer with the "interruptOnDone()" goroutine. The downside now is that context handling will now not be immediate, it will instead have to check at the next sqlite3 step() for a canceled context. In practice though this shouldn't cause (us at least) any issues.

You can confirm this by triggering #2774 on a testrig instance (same methodology as with #2728) then attempting to shutdown the instance. It will hang on "database locked". Switching to this branch the issue will no longer be there. Switching to this branch you'll also notice that your database WAL file gets regularly cleaned up.

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@NyaaaWhatsUpDoc
Copy link
Member Author

marking this is draft until @daenney @tsmethurst agree (or not! in which case, closed it shall be :p) this is the best solution for now

@tsmethurst tsmethurst marked this pull request as ready for review April 5, 2024 09:57
@tsmethurst
Copy link
Contributor

We chatted about this in Matrix and decided it's a good fix for now because it solves our immediate problem! Ideally a fix should be done upstream so we don't have to maintain a fork, however, but solving the immediate issue is more important for now :)

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.

2 participants