France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
1 stars 2 forks source link

Make sure async propagation does not block other requests #1047

Open smadbe opened 3 months ago

smadbe commented 3 months ago

Motivations

We moved some propagation to async because there were too long. But of course, we have to make sure these propagation may not block other sync requests (which would wait for a 15min propagation to complete).

As propagation works by iteration, it would convenient if:

Note: that would also solve the problem of a propagation which would run for >15min and so which would not progress when killed after 15min by lambda.

Subtasks

GeoffreyHuck commented 1 month ago

As discussed the other day, the propagation should schedule the run of another propagation if it's getting killed at 15min.

GeoffreyHuck commented 1 month ago

Notes on the problem

Two processes that can cause the problem

  1. A service is called that schedules a big propagation
  2. Another service is called that wants to run a normally small propagation, but since the big propagation is in the propagations tables, it ends up calling a big propagation, and timeout

or

  1. A service schedule a big async results propagation (this one sets a lock)
  2. The propagation is run is async, and the lock is taken
  3. Another service wants to run the results propagation but cannot get the lock, and timeout

Solutions

We can either:

We already talked about it on the phone and we decided to make all propagation async.

GeoffreyHuck commented 1 month ago

Tasks