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 database locked error #2808

Merged
merged 1 commit into from Mar 4, 2023

Conversation

jonaswinkler
Copy link
Member

@jonaswinkler jonaswinkler commented Mar 3, 2023

Proposed change

Changing the owner on many documents (lets say 2000+) takes a while. With SQLite, "Database locked" errors can be observed, since both the main thread changing permissions as well as the running celery task changing owners run at the same time. Updating owners is actually very fast and doesn't require a separate task.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain)

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #2808 (c87ca25) into dev (3dbb7e5) will increase coverage by 0.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##              dev    #2808      +/-   ##
==========================================
+ Coverage   93.04%   93.14%   +0.09%     
==========================================
  Files         149      149              
  Lines        6395     6386       -9     
==========================================
- Hits         5950     5948       -2     
+ Misses        445      438       -7     
Flag Coverage Δ
backend 93.14% <0.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/documents/bulk_edit.py 86.48% <0.00%> (-0.19%) ⬇️
src/documents/tasks.py 92.30% <ø> (+2.67%) ⬆️
src/paperless_mail/parsers.py 92.61% <0.00%> (+0.98%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions github-actions bot added the bug Bug report or a Bug-fix label Mar 3, 2023
@jonaswinkler jonaswinkler self-assigned this Mar 3, 2023
@jonaswinkler
Copy link
Member Author

I disagree with the failing check, I've actually increased coverage by removing uncovered lines :)

Copy link
Member

@stumpylog stumpylog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're both right. This increases coverage, but the changed lines aren't covered (but I don't think they were before). I'm fine ignoring it in this case.

Actual change makes sense, it should be a quick operation

@jonaswinkler jonaswinkler merged commit db9733f into dev Mar 4, 2023
@jonaswinkler jonaswinkler deleted the bugfix-database-locked-on-permission-change branch March 4, 2023 15:25
@shamoon shamoon added this to the v1.14 milestone Mar 7, 2023
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend bug Bug report or a Bug-fix small-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants