From b3fb4c1134d3370bbd623fcf6e153ddeada6b446 Mon Sep 17 00:00:00 2001 From: Roman Trunov Date: Tue, 14 Apr 2020 00:01:24 +0300 Subject: [PATCH] transitioner: Fix race condition with file_upload_handler --- db/boinc_db.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index e5a6bbaf91..b41ea6cb71 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -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) {