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

Something is causing a lock on some records on "repositories" table #1529

Closed
2 of 7 tasks
andreynering opened this issue Apr 21, 2017 · 9 comments
Closed
2 of 7 tasks
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug

Comments

@andreynering
Copy link
Contributor

  • Gitea version (or commit ref): Current master (4bea219)
  • Git version: git version 2.10.2.windows.1
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: none

Description

I think it might be PostgreSQL specific, since I tried on try.gitea.io, which uses MariaDB, but couldn't reproduce.

In different installations I saw this issue where it isn't possible to update any information of a repository (e.g. change its name or if it's private or public) or even delete the repo. When you click the Update or Delete button, the request takes forever and nothing happens.

Doing some investigation I found that it's a lock issue in the DB. If I try to update or delete the record in my SQL editor it takes forever and never completes. But if I stop Gitea and try again than it works. If I start Gitea again the lock happens again.

I think it may be an issue with an migration or other startup action (probably a mising commit or rollback), but could not fint it yet. I'm posting here to know it anyone has any idea.

@andreynering andreynering added this to the 1.2.0 milestone Apr 21, 2017
@lunny
Copy link
Member

lunny commented Apr 21, 2017

Then have you tested before 4bea219's version ?

@lunny
Copy link
Member

lunny commented Apr 21, 2017

I think this should be caused by #1332 which we just merged.

@lunny lunny added the issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP label Apr 21, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Apr 21, 2017

@andreynering Could you verify using this? https://wiki.postgresql.org/wiki/Lock_Monitoring

And get the last N lines from xorm.log :)

@lunny
Copy link
Member

lunny commented Apr 21, 2017

@andreynering But this PR is not related with repository operations. @bkcsoft a new question, we need delete all commitstatus when a repo will be deleted.

@bkcsoft
Copy link
Member

bkcsoft commented Apr 21, 2017

@lunny Status-API isn't used by anything, and has no Foreign Keys to Repository either (that should probably be fixed though...). So I don't see how it could affect the DB at all 😕

@andreynering
Copy link
Contributor Author

I noticed this issue during this week, but it may exist even longer. So has nothing to do with the status API just merged.

@bkcsoft
Copy link
Member

bkcsoft commented Apr 21, 2017

Well, we found other issues in the Status-API PR anyhow so 💯 #1332 (review) (Double Transactions ❤️ )

@andreynering
Copy link
Contributor Author

andreynering commented May 9, 2017

After updating with current master, this was somehow fixed, but I have no idea how. 😱

@lunny lunny removed this from the 1.2.0 milestone May 10, 2017
@lunny
Copy link
Member

lunny commented May 10, 2017

Since no PR to fix this, I moved it from 1.2.0

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP type/bug
Projects
None yet
Development

No branches or pull requests

3 participants