Skip to content

Commit bb5d4c8

Browse files
committed
Don't try to update aborted judgings
This (typically?) happens while cancelling a rejudging while there are judgedaemons actively judging. Fixes errors like ``` [Nov 23 13:34:53.075] judgedaemon[526392]: warning: Error while executing curl POST to url http://localhost/domjudge/api/judgehosts/add-judging-run/tiger-1/1555747: http status code: 500, request size = 67745, response: array ( 'code' => 500, 'message' => 'internal bug: the evaluated result changed during judging', 'class' => 'BadMethodCallException', 'trace' => array ( 0 => array ( 'namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => '', 'file' => '/home/jaap/domjudge/git/domjudge/webapp/src/Controller/API/JudgehostController.php', 'line' => 1053, 'args' => array ( ), ), ... ```
1 parent 1c80b26 commit bb5d4c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webapp/src/Controller/API/JudgehostController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,12 @@ private function addSingleJudgingRun(
10491049
// Only update if the current result is different from what we had before.
10501050
// This should only happen when the old result was NULL.
10511051
if ($oldResult !== $result) {
1052+
if ($oldResult === 'aborted') {
1053+
// This judging was cancelled while we worked on it,
1054+
// probably as part of a cancelled rejudging.
1055+
// Throw away our work, and return that we're done.
1056+
return false;
1057+
}
10521058
if ($oldResult !== null) {
10531059
throw new BadMethodCallException('internal bug: the evaluated result changed during judging');
10541060
}

0 commit comments

Comments
 (0)