Project

General

Profile

Actions

Defect #44375

open

Concurrency problem in project deletion / project marking for deletion

Added by Felix Schäfer 25 days ago. Updated about 24 hours ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Database
Target version:
Resolution:
Fixed
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 25 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 #2

Updated by Go MAEDA 4 days ago

  • Target version set to 6.1.5

Setting the target version to 6.1.5.

Actions #3

Updated by Go MAEDA about 24 hours ago

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r25114. Thank you for the contribution.

Actions

Also available in: Atom PDF