Merge pull request #3603 from stream1972/stream_for_merge

transitioner: Fix race condition with file_upload_handler
This commit is contained in:
Kevin Reed 2020-05-11 09:50:54 -05:00 committed by GitHub
commit 8ae81c10d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1800,8 +1800,11 @@ int DB_TRANSITIONER_ITEM_SET::update_workunit(
sprintf(buf, " file_delete_state=%d,", ti.file_delete_state);
strcat(updates, buf);
}
// Don't update transition_time if it changed in database because something
// happened in background (usually, another result was uploaded).
// Instead, force another run of transitioner to handle these changes.
if (ti.transition_time != ti_original.transition_time) {
sprintf(buf, " transition_time=%d,", ti.transition_time);
sprintf(buf, " transition_time=if(transition_time=%d,%d,%d),", ti_original.transition_time, ti.transition_time, (int)time(NULL));
strcat(updates, buf);
}
if (ti.hr_class != ti_original.hr_class) {