Skip to content

Commit fb7c3ca

Browse files
Send less event updates for judgements in parallel mode.
We used to send event updates for all testcases that came in after we already determined the final verdict for a problem. Now we check if we already have a previous end time for the judgement, and then we don't do this anymore. Note that race conditions can still make it such that we send multiple update events, where two judgehosts know the result at the same time and. However, this happens way less often.
1 parent ef55f05 commit fb7c3ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webapp/src/Controller/API/JudgehostController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,11 @@ private function addSingleJudgingRun(
10231023
if (!$hasNullResults || $lazyEval !== DOMJudgeService::EVAL_FULL) {
10241024
// NOTE: setting endtime here determines in testcases_GET
10251025
// whether a next testcase will be handed out.
1026+
$this->logger->error('Judging %d is done, setting endtime, it had %d', [ $judging->getJudgingid(), $judging->getEndtime() ]);
1027+
$this->logger->error('Verdict is %s', [$result]);
1028+
$sendJudgingEvent = !$judging->getEndtime();
10261029
$judging->setEndtime(Utils::now());
10271030
$this->maybeUpdateActiveJudging($judging);
1028-
$sendJudgingEvent = true;
10291031
}
10301032
$this->em->flush();
10311033

0 commit comments

Comments
 (0)