cms-dev / cms-dev/cms

Use websockets in CWS for notifications to contestants

Open
#1,357 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cws feature_request
Dominant language
Python
Stars
1k
Forks
412
Avg merge
6d 10h
Merged PRs (30d)
3

Description

Currently CWS gets notifications by polling every 30 seconds, and gets submission statuses by doing polling with exponential backoff (starting at 1 sec, delay multiplier about 1.5). Instead, we could use websockets to deliver the results as soon as they become available. As a demo of how effective this might be, currently for contests with a public scoreboard, you can see your score change on RWS before it updates in CWS (because RWS already uses websockets, at least when configured correctly).

This might also require adding some new rpc's to notify CWS of new submission results, but hopefully not too much work.

On the other hand, it would probably be a good idea to have a fallback for when websockets don't work (e.g. broken reverse proxy config), to make sure notifications aren't missed entirely.

Similarly, I think there's a bunch of polling in AWS which could also theoretically use websockets.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing polling in CWS and the websocket implementation in RWS, then compare the related polling in AWS. Define the RPCs needed to deliver submission results and notifications, and verify that a reliable fallback prevents missed notifications when websockets are unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.