Skip to content
Snippets Groups Projects
Unverified Commit f541efc9 authored by Manuel Gundlach's avatar Manuel Gundlach Committed by GitHub
Browse files

Handle IntegrityError on file commit gracefully (#1223)

Fixes #1214.
parent db270180
Branches
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# Copyright © 2013 Luca Wehrstedt <luca.wehrstedt@gmail.com> # Copyright © 2013 Luca Wehrstedt <luca.wehrstedt@gmail.com>
# Copyright © 2016 Luca Versari <veluca93@gmail.com> # Copyright © 2016 Luca Versari <veluca93@gmail.com>
# Copyright © 2021 Fabian Gundlach <320pointsguy@gmail.com> # Copyright © 2021 Fabian Gundlach <320pointsguy@gmail.com>
# Copyright © 2023 Manuel Gundlach <manuel.gundlach@gmail.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
...@@ -362,7 +363,11 @@ class DBBackend(FileCacherBackend): ...@@ -362,7 +363,11 @@ class DBBackend(FileCacherBackend):
# If someone beat us to adding the same object to the database, we # If someone beat us to adding the same object to the database, we
# should at least drop the large object. # should at least drop the large object.
LargeObject.unlink(fobj.loid) LargeObject.unlink(fobj.loid)
logger.warning("File %s (%s) caused an IntegrityError, ignoring.", logger.info("File %s (%s) caused an IntegrityError, ignoring. "
"Note: If the file is a compiled submission "
"executable, this can occur when a contestant has "
"submitted identical source code multiple times, "
"and is harmless in that case.",
digest, desc) digest, desc)
return False return False
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment