cms icon indicating copy to clipboard operation
cms copied to clipboard

Use websockets in CWS for notifications to contestants

Open prandla opened this issue 6 months ago • 1 comments

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.

prandla avatar Jun 05 '25 22:06 prandla

I have mixed feelings about this -- websockets are somewhat tricky to configure correctly.

Why not do long polling instead?

veluca93 avatar Jun 06 '25 08:06 veluca93