When executing LocationService::moveSubtree() concurrently, MySQL deadlocks can happen.
Example of such error:
The issue was reproduced by creating a PublishVersionSignalSlot that uses LocationService::moveSubtree() to move the freshly created Content Object to another location. Then, the script was used that:
- Logs in with n sessions (POST /user/sessions)
- Creates n content items using each session (POST /content/objects)
- Publishes the n content items created (POST /content/objects/<contentId>/versions/<versionId>)
Steps to reproduce
- Create new eZ Platform installation.
- Create and publish new Content Object. Note its Location remote Id.
- Create the following files inside AppBundle. You can use the AppBundle attached to this issue (just remember to change the Location remote Id inside LocationTestSlot).
- Run the script to concurently create and publish multiple Content Objects. Such script written in node.js can be found in the attachment.
- Some of the requests should error out with the message mentioned above. Since the issue only happens in concurrency situations, there is no way to reproduce the issue every time. If there was no error, try to run the script again.