Project

General

Profile

Actions

Defect #44375

open

Concurrency problem in project deletion / project marking for deletion

Added by Felix Schäfer 5 days ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Resolution:
Affected version:

Description

The problem we noticed was:
- a user selects some projects to be bulk deleted and submits the request
- other projects than the selected projects get marked as STATUS_SCHEDULED_FOR_DELETION
- the correct originally select projects are deleted

Our analysis showed that between selecting the projects in the ProjectsController#bulk_delete and updating the projects with the STATUS_SCHEDULED_FOR_DELETION in DestroyProjectJob.schedule another previous DestroyProjectJob might change the Project tree, which then leads to project.self_and_descendants in DestroyProjectJob.schedule to select the wrong projects.


Files

Actions #1

Updated by Felix Schäfer 5 days ago

See the attached patch. The patch is by Jens Krämer.

This changes the "mark project as scheduled for deletion" operation to be inside a transaction and to not use cached lft and rgt values and makes it essentially atomic. This ensures no other operation can change the project tree while the "mark project as scheduled for deletion" operation is executed.

Actions

Also available in: Atom PDF