From 96f7f9cf220bf0489c0698d16fa84ccedf8f7acc Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Fri, 3 Oct 2025 20:50:21 +0200 Subject: [PATCH] Give back unfinished judging_runs/judgetasks in repeated rejudgings. judgedaemons check in after start-up and after failed judgetask, see https://github.com/DOMjudge/domjudge/blob/2222a867f99275cbdb8e81d4681e47522a29669f/judge/judgedaemon.main.php#L984 Checking in has the side effect that judgetasks that no longer need to be executed are given back. Previously, we checked whether either the judging or the rejudging was valid, assuming that active rejudgings are marked as valid. This is not true for repeated rejudgings where only the last instance is "valid". For the check, it doesn't matter whether a rejudging is valid, only whether a judging is associated with one. Fixes #3069. --- webapp/src/Controller/API/JudgehostController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/Controller/API/JudgehostController.php b/webapp/src/Controller/API/JudgehostController.php index cd578247f3..e9b184606f 100644 --- a/webapp/src/Controller/API/JudgehostController.php +++ b/webapp/src/Controller/API/JudgehostController.php @@ -175,7 +175,7 @@ public function createJudgehostAction(Request $request): array ->andWhere('jh.hostname = :hostname') ->andWhere('j.judgingid = jt.jobid') ->andWhere('jr.runresult IS NULL') - ->andWhere('j.valid = 1 OR r.valid = 1') + ->andWhere('j.valid = 1 OR j.rejudging IS NOT NULL') ->andWhere('j.result != :compiler_error') ->setParameter('hostname', $hostname) ->setParameter('compiler_error', 'compiler-error')