Skip to content

Latest watchdog would trigger on_opened events #1129

@cuom1999

Description

@cuom1999

Latest commit from watchdog: gorakhargosh/watchdog@f3dfc4b

It means SendProblemsHandler.on_any_event in monitor.py would also trigger on_opened. Judges need to trigger this to read test data and init file. This leads to supported-problems being sent multiple times on every submission. Suppose there are n judges, bridged will receive at least 2 * n supported-problems packets on each submission, which leads to 2n SQL update queries.

One simple fix is to add this line in SendProblemsHandler.on_any_event.

def on_any_event(self, event):
        if event.event_type == "opened":
            return
        if self.callback is not None:
            self.callback()
        if self.refresher is not None:
            self.refresher.refresh()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions