Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProxyService bugfix #1244

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions cms/service/ProxyService.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
contest = Contest.get_from_id(self.contest_id, session)

if contest is None:
logger.error("Received request for unexistent contest "
logger.error("Received request for non-existent contest "

Check warning on line 333 in cms/service/ProxyService.py

View check run for this annotation

Codecov / codecov/patch

cms/service/ProxyService.py#L333

Added line #L333 was not covered by tests
"id %s.", self.contest_id)
raise KeyError("Contest not found.")

Expand Down Expand Up @@ -474,7 +474,7 @@

if submission is None:
logger.error("[submission_scored] Received score request for "
"unexistent submission id %s.", submission_id)
"non-existent submission id %s.", submission_id)
raise KeyError("Submission not found.")

# ScoringService sent us a submission of another contest, they
Expand Down Expand Up @@ -518,7 +518,7 @@

if submission is None:
logger.error("[submission_tokened] Received token request for "
"unexistent submission id %s.", submission_id)
"non-existent submission id %s.", submission_id)
raise KeyError("Submission not found.")

# ScoringService sent us a submission of another contest, they
Expand Down Expand Up @@ -562,14 +562,18 @@
"""
with SessionGen() as session:
task = Task.get_from_id(task_id, session)
if task is None:
logger.warning("Dataset update for non-existent task %d.", task_id)
raise KeyError("Task not found.")

Check warning on line 567 in cms/service/ProxyService.py

View check run for this annotation

Codecov / codecov/patch

cms/service/ProxyService.py#L565-L567

Added lines #L565 - L567 were not covered by tests

dataset = task.active_dataset

# This ProxyService may focus on a different contest, and it should
# ignore this update.
if task.contest_id != self.contest_id:
logger.debug("Ignoring dataset change for task %d of contest "
"%d (this ProxyService considers contest %d "
"only).", task_id, task.contest.id,
"only).", task_id, task.contest_id,
self.contest_id)
return

Expand Down
Loading