From be3184aa377971cd9d496d01a9a69c82113d6b7c Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Fri, 22 Nov 2024 16:24:11 +0100 Subject: [PATCH] When cancelling a rejudging, also delete the corresponding queue tasks. Previously, when you did a large rejudging (say of a whole contest), abort it immediately, you would have a lot of queuetasks where each queue task doesn't have any remaining judge task to process. The judgedaemon would process these one at a time and assume there is no work to be done and sleep until processing the next one, so it would take hours to clean up the queue. We should address that behavior separately. --- webapp/src/Service/RejudgingService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/src/Service/RejudgingService.php b/webapp/src/Service/RejudgingService.php index 630fe65122..c9aab6da74 100644 --- a/webapp/src/Service/RejudgingService.php +++ b/webapp/src/Service/RejudgingService.php @@ -335,6 +335,8 @@ public function finishRejudging(Rejudging $rejudging, string $action, ?callable SET result = :aborted WHERE judgingid = :judgingid AND result IS NULL', ['aborted' => 'aborted', 'judgingid' => $submission['judgingid']]); + $this->em->getConnection()->executeQuery( + 'DELETE FROM queuetask WHERE judgingid = :judgingid', ['judgingid' => $submission['judgingid']]); } else { $error = "Unknown action '$action' specified."; throw new BadMethodCallException($error);