Skip to content

Commit

Permalink
When cancelling a rejudging, also delete the corresponding queue tasks.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
meisterT committed Nov 22, 2024
1 parent 4aacc80 commit be3184a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webapp/src/Service/RejudgingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be3184a

Please sign in to comment.