Project copy Lock wait timeout
CSV download of a lot of tickets is carried out.
Project copy is performed during download execution.
ActiveRecord::StatementInvalid (Mysql::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `projects` SET `lft` = CASE WHEN `lft` BETWEEN 197 AND 284 THEN `lft` + 286 - 284 WHEN `lft` BETWEEN 285 AND 286 THEN `lft` + 197 - 285 ELSE `lft` END, `rgt` = CASE WHEN `rgt` BETWEEN 197 AND 284 THEN `rgt` + 286 - 284 WHEN `rgt` BETWEEN 285 AND 286 THEN `rgt` + 197 - 285 ELSE `rgt` END, `parent_id` = CASE WHEN id = 146 THEN NULL ELSE `parent_id` END ): app/models/project.rb:300:in `set_parent!' app/models/project.rb:278:in `set_allowed_parent!' app/controllers/projects_controller.rb:108:in `copy' passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request' passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
Setup of parents is not completed.
It seems that transaction management is wrong.
Setup of parents is not included in a transaction scope.
#1 Updated by Holger Just over 11 years ago
This seems to be more of a restriction of MySQL ISAM tables than a Redmine restriction.
As MyISAM does not support transaction, they are emulated using locks. The issue should vanish if you use a DBMS with proper transaction support (e.g. PostgreSQL or MySQL with InnoDB)