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

5 participants
@zeripath
Copy link
Contributor

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 sqlite deadlock when assigning to a PR
Fix 5639

Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-io

This comment has been minimized.

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 label Jan 4, 2019

@bkcsoft bkcsoft added lgtm/need 1 and removed lgtm/need 2 labels Jan 4, 2019

More possible deadlocks found and fixed
Signed-off-by: Andrew Thornton <art27@cantab.net>
@lafriks

lafriks approved these changes Jan 4, 2019

@bkcsoft bkcsoft added lgtm/done and removed lgtm/need 1 labels Jan 4, 2019

@techknowlogick techknowlogick merged commit 6311e4c into go-gitea:master Jan 4, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details

@zeripath zeripath deleted the zeripath:issue-5639-fix-deadlock branch Jan 4, 2019

@lafriks

This comment has been minimized.

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 (go-gitea#5640)
* Fix sqlite deadlock when assigning to a PR

Fix 5639

Signed-off-by: Andrew Thornton <art27@cantab.net>

* More possible deadlocks found and fixed

Signed-off-by: Andrew Thornton <art27@cantab.net>

techknowlogick added a commit that referenced this pull request Jan 5, 2019

Fix sqlite deadlock when assigning to a PR (#5640) (#5642)
* Fix sqlite deadlock when assigning to a PR

Fix 5639

Signed-off-by: Andrew Thornton <art27@cantab.net>

* More possible deadlocks found and fixed

Signed-off-by: Andrew Thornton <art27@cantab.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment