Skip to content

FTS-1936: Remove potential deadlock in MySqlAPI::terminateReuseProcess(..) and make DB queries more efficient

Joao Pedro Lopes requested to merge FTS-1936 into develop

FTS-1936: Change MySqlAPI::terminateReuseProcess(..) to examine less database rows and remove risk of potential deadlock.

The pid filer was removed from the WHERE clause in the UPDATE statement because updating based on the job_id is enough.

Instead of updating multiple rows on the t_file table that share the same job_id, this change creates a transaction and inside it updates, in order, each row on the t_file table individually.

The new algorithm is the following:

  1. SELECT the rows to be updated
  2. Start a transaction
  3. In a loop UPDATE each row individually using the file_id
  4. Commit the transaction

Closes FTS-1936

Edited by Mihai Patrascoiu

Merge request reports