France-ioi / AlgoreaBackend

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

Raise groupsRelationsLockTimeout & itemsRelationsLockTimeout to 50 seconds #1198

Closed zenovich closed 1 month ago

zenovich commented 1 month ago

This is a quick fix! It's a temporal solution for more reliable creation of temporary users (now we often fail after 3 seconds of waiting for the named lock).

Related to #1197

I'll try finding a better solution ASAP, but for now this one should fix the issue. The real problem consists of several things:

  1. We do not retry (and never retried) on timeouts on named locks acquiring.
  2. The relations (items_items/groups_groups) creation/deletion is always done under named locks, one named lock for all the operations modifying each graph. This means only one session can modify the groups relation graph at each moment (e.g. we can register only one temporary user at a time, and we cannot register users concurrently with other groups graph modifications like adding/removing group relations). The same is true for the items relations graph.
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (a383562) to head (322f858). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1198 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 237 237 Lines 14663 14663 ========================================= Hits 14663 14663 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zenovich commented 1 month ago

So that will be even slower .. (but we avoid failure)

Right, but I'm going to fix this ASAP.