-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
random database lock when sqlite database #2040
Comments
And maybe we should pause |
Reference: https://sqlite.org/unlock_notify.html |
@typeless Unless that is available in https://github.com/mattn/go-sqlite3 and https://github.com/go-xorm/xorm/ we can't use it 😞 |
@bkcsoft Agreed. This would probably need to be fixed upstream. |
I hope #2116 fixes the issue |
closes #2040 upstream commit: mattn/go-sqlite3@acfa601
Reopening, since it seems it not really fixed. |
Same for me.
|
Potential alternatives that could fix this: https://github.com/bvinc/go-sqlite-lite |
Author of I think the current mattn driver is the best one to use if you require a |
@bvinc thanks for your reply, It's a good idea to send a PR to set open connections to 1 when using mattn/go-sqlite3 |
What is the best way to migrate from sqlite to postgresql? |
Now that mattn/go-sqlite3#439 is merged, we can either use the tip right away or wait for the new release of Edit: I hope the users don't have to specify Edit2: I changed my mind. If one wants to build Gitea from source, he should be capable of handling the additional flag. We should update the documentation accordingly though. |
at first, we need a PR to update go-sqlite3 library. |
@typeless go-sqlite3 library with sqlite_unlock_notify tag seems to not build on win 32bit https://drone.gitea.io/go-gitea/gitea/3536/18 |
@sapk Similar to mattn/go-sqlite3#238. Will submit a fix soon. |
@typeless exactly what I was searching but I use the terms |
I have submitted mattn/go-sqlite3#654. |
@typeless use gox to cross-compile ? |
@sapk I just installed it. But after typing Edit: fixed at mattn/go-sqlite3#655 |
Just type |
#5162 fixes the CI failure and |
Closed this since it's not a system problem any more. If there is any issue please fire another issue. |
During registration, one may be required to give their email address, to be verified and activated later. However, if one makes a mistake, a typo, they may end up with an account that cannot be activated due to having a wrong email address. They can still log in, but not change the email address, thus, no way to activate it without help from an administrator. To remedy this issue, lets allow changing the email address for logged in, but not activated users. This fixes gitea#17785. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit aaaece28e4c6a8980cef932e224e84933d7c9262) (cherry picked from commit 639dafabec0a5c1f943b44ca02f72c5ba2fc5e10) (cherry picked from commit d699c12) [GITEA] Allow changing the email address before activation (squash) cache is always active This needs to be revisited because the MailResendLimit is not enforced and turns out to not be tested. See e7cb8da * Always enable caches (go-gitea#28527) (cherry picked from commit 43ded8e) Rate limit pre-activation email change separately Changing the email address before any email address is activated should be subject to a different rate limit than the normal activation email resending. If there's only one rate limit for both, then if a newly signed up quickly discovers they gave a wrong email address, they'd have to wait three minutes to change it. With the two separate limits, they don't - but they'll have to wait three minutes before they can change the email address again. The downside of this setup is that a malicious actor can alternate between resending and changing the email address (to something like `user+$idx@domain`, delivered to the same inbox) to effectively halving the rate limit. I do not think there's a better solution, and this feels like such a small attack surface that I'd deem it acceptable. The way the code works after this change is that `ActivatePost` will now check the `MailChangeLimit_user` key rather than `MailResendLimit_user`, and if we're within the limit, it will set `MailChangedJustNow_user`. The `Activate` method - which sends the activation email, whether it is a normal resend, or one following an email change - will check `MailChangedJustNow_user`, and if it is set, it will check the rate limit against `MailChangedLimit_user`, otherwise against `MailResendLimit_user`, and then will delete the `MailChangedJustNow_user` key from the cache. Fixes go-gitea#2040. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu> (cherry picked from commit e35d2af2e56f4ecb3a4f6d1109d02c8aa1a6d182) (cherry picked from commit 03989418a70d3445e0edada7fbe5a4151d7836b1) (cherry picked from commit f50e0dfe5e90d6a31c5b59e687580e8b2725c22b) (cherry picked from commit cad9184a3653e6c80de2e006a0d699b816980987) (cherry picked from commit e2da5d7fe13a685606913a131687a94f9f5fcfeb) (cherry picked from commit 3a80534d4db523efe56b368489f81dc1cb2c99f7)
This is a summary issue since there are so many issues to report the database lock when using sqlite. I will close all other issues and please continue in this issue.
The text was updated successfully, but these errors were encountered: