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

Fix sqlite deadlock when assigning to a PR #5640

Merged
merged 2 commits into from
Jan 4, 2019

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jan 4, 2019

When assigning a user to a PR there was a call to issue.PullRequest.APIFormat() which causes an deadlock in sqlite due to the internal use of the xorm engine. This PR changes this to issue.PullRequest.apiFormat(sess) passing in the current session and thus avoiding the deadlock.

A few other possible deadlocks were also identified.

Fix #5639

Fix 5639

Signed-off-by: Andrew Thornton <[email protected]>
@codecov-io
Copy link

codecov-io commented Jan 4, 2019

Codecov Report

Merging #5640 into master will increase coverage by <.01%.
The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5640      +/-   ##
==========================================
+ Coverage   37.81%   37.81%   +<.01%     
==========================================
  Files         322      322              
  Lines       47485    47489       +4     
==========================================
+ Hits        17957    17959       +2     
- Misses      26939    26941       +2     
  Partials     2589     2589
Impacted Files Coverage Δ
models/issue_mail.go 12% <0%> (ø) ⬆️
models/issue.go 47.6% <0%> (ø) ⬆️
models/repo_watch.go 65.11% <0%> (ø) ⬆️
models/org.go 69.18% <100%> (+0.12%) ⬆️
models/issue_user.go 72.72% <100%> (ø) ⬆️
models/issue_assignees.go 40.86% <75%> (+0.64%) ⬆️
models/repo.go 43.87% <0%> (-0.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e90103...6664000. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 4, 2019
@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 4, 2019
@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 4, 2019
@techknowlogick techknowlogick merged commit 6311e4c into go-gitea:master Jan 4, 2019
@zeripath zeripath deleted the issue-5639-fix-deadlock branch January 4, 2019 22:02
@lafriks
Copy link
Member

lafriks commented Jan 4, 2019

Please backport to release/v1.7

zeripath added a commit to zeripath/gitea that referenced this pull request Jan 5, 2019
* Fix sqlite deadlock when assigning to a PR

Fix 5639

Signed-off-by: Andrew Thornton <[email protected]>

* More possible deadlocks found and fixed

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick pushed a commit that referenced this pull request Jan 5, 2019
* Fix sqlite deadlock when assigning to a PR

Fix 5639

Signed-off-by: Andrew Thornton <[email protected]>

* More possible deadlocks found and fixed

Signed-off-by: Andrew Thornton <[email protected]>
@lafriks lafriks added the backport/done All backports for this PR have been created label Jan 5, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assigning a PR causes the server to hang
5 participants