From d49393ae002028e0bbf4915ef9079876fd3ea367 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Sun, 26 Oct 2025 12:04:32 +0100 Subject: [PATCH 1/2] Wrap assignment inside if in parentheses for clarity and also test against `nullptr` (even though that's zero, thus false by definition). To silence the coverity scan warning. --- judge/runguard.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/runguard.cc b/judge/runguard.cc index e7e3e590fb..be0fa6db42 100644 --- a/judge/runguard.cc +++ b/judge/runguard.cc @@ -1289,7 +1289,7 @@ int main(int argc, char **argv) * exceeded, when running via SSH. */ FILE *fp = nullptr; const char *oom_score_path = "/proc/self/oom_score_adj"; - if ( fp = fopen(oom_score_path, "r+") ) { + if ( (fp = fopen(oom_score_path, "r+"))!=nullptr ) { if ( fscanf(fp,"%d", &ret)!=1 ) error(errno,"cannot read from `%s'", oom_score_path); if ( ret<0 ) { int oom_reset_value = 0; From 001ee3d8140ee9efceeb66768e73119a2d155986 Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Sun, 26 Oct 2025 16:45:41 +0100 Subject: [PATCH 2/2] Turn off innodb-snapshot-isolation. This is causing some trouble on CI in our integration tests, e.g. https://github.com/DOMjudge/domjudge/actions/runs/18819431955/job/53692609380: ``` 2025-10-26T15:17:47.393646+00:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "["An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"]" at ImportProblemService.php line 8 96 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): [\"An exception occurred while executing a query: SQLSTATE[40001 ]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction\"] at /opt/domjudge/domserver/webapp/src/Service/ImportProblemService. php:896)"} [] ``` Related: https://github.com/DOMjudge/domjudge/issues/2848 --- .github/jobs/baseinstall.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/jobs/baseinstall.sh b/.github/jobs/baseinstall.sh index ce7e90e613..50db376a52 100755 --- a/.github/jobs/baseinstall.sh +++ b/.github/jobs/baseinstall.sh @@ -67,6 +67,9 @@ password=${MYSQL_ROOT_PASSWORD} EOF cat ~/.my.cnf +# TODO: Remove after fixing https://github.com/DOMjudge/domjudge/issues/2848 +mysql_root "SET GLOBAL innodb_snapshot_isolation = OFF;" + mysql_root "CREATE DATABASE IF NOT EXISTS \`$DATABASE_NAME\` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" mysql_root "CREATE USER IF NOT EXISTS \`domjudge\`@'%' IDENTIFIED BY 'domjudge';" mysql_root "GRANT SELECT, INSERT, UPDATE, DELETE ON \`$DATABASE_NAME\`.* TO 'domjudge'@'%';" @@ -79,6 +82,7 @@ mysql_root "SELECT USER();" mysql_root "SELECT user,host FROM mysql.user" mysql_root "SET GLOBAL max_allowed_packet=1073741824" mysql_root "SHOW GLOBAL STATUS LIKE 'Connection_errors_%'" +mysql_root "SHOW VARIABLES LIKE 'innodb_snapshot_isolation'" mysql_root "SHOW VARIABLES LIKE '%_timeout'" echo "unused:sqlserver:$DATABASE_NAME:domjudge:domjudge:3306" > /opt/domjudge/domserver/etc/dbpasswords.secret mysql_user "SELECT CURRENT_USER();"