Project

General

Profile

Actions

Defect #44375

closed

Concurrency problem in project deletion / project marking for deletion

Added by Felix Schäfer about 2 months ago. Updated 20 days ago.

Status:
Closed
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 about 2 months 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 25 days ago

  • Target version set to 6.1.5

Setting the target version to 6.1.5.

Actions #3

Updated by Go MAEDA 22 days 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 #4

Updated by Go MAEDA 20 days ago

  • Status changed from Resolved to Closed

Merged the fix into the stable branches in r25120 and r25121.

Actions

Also available in: Atom PDF