archivematica / Issues

Issues repository for the Archivematica project
GNU Affero General Public License v3.0
16 stars 1 forks source link

Problem: some client scripts keep db transactions open for too long #313

Open sevein opened 5 years ago

sevein commented 5 years ago

Expected behaviour No component in our system should maintain database transactions open for too long because it degrades the overall performance of the database.

Current behaviour E.g. sanitize_object_names.py took 12 minutes in a transfer with 20k files maintaining a transaction open while it was running. This is new behaviour introduced in AM18's new task scheduling redesign.

Steps to reproduce

  1. Start a new transfer with a big number of files (e.g. 5k files)
  2. While Sanitize object's file and directory names runs, monitor the innodb engine and observe the number of active transactions.

Your environment (version of Archivematica, OS version, etc) AM18-dev

Related: https://github.com/archivematica/Issues/issues/313


For Artefactual use: Please make sure these steps are taken before moving this issue from Review to Verified in Waffle:

sevein commented 5 years ago

See how this same problem was addressed in email_fail_report: https://github.com/artefactual/archivematica/blob/707e9332f0bebf4c32def012e30752314a207d48/src/MCPClient/lib/clientScripts/email_fail_report.py#L194-L223.