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

Improve performance when deleting regions #2560

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

david-venhoff
Copy link
Member

Short description

This pr suppresses most linkcheck deletion listeners when deleting regions, which hopefully improves performance enough that deleting big regions will be possible again.
Currently the Link post_delete handlers from linkcheck will still run, which is unnecessary. However this is hopefully not a big problem, since those only run per link and not per page translation.

Proposed changes

  • Delete regions with the disable_listeners context manager

Side effects

  • The db may be in an inconsistent state after deleting a region. However, this should only result in internal links to content of the deleted region not being flagged as broken. Also the db will be fixed after the next run of the findlinks management command.

Resolved issues

fixes: #2336


Pull Request Review Guidelines

This commit supresses most linkcheck deletion listeners when deleting
regions. This improves the performance a lot and the inconsistent db
will be fixed when the findlinks command runs next.
@david-venhoff david-venhoff requested a review from a team as a code owner November 18, 2023 12:57
Copy link

codeclimate bot commented Nov 18, 2023

Code Climate has analyzed commit daeb435 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 79.0% (0.0% change).

View more on Code Climate.

Copy link
Member

@MizukiTemma MizukiTemma left a comment

Choose a reason for hiding this comment

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

Looks good 😃
Thank you for analysing the problem 👍

@david-venhoff david-venhoff merged commit 9726303 into develop Nov 24, 2023
5 checks passed
@david-venhoff david-venhoff deleted the bugfix/slow_region_deletion branch November 24, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deadlock when deleting regions
3 participants