Failure#f1
Players produced tournament events faster than the per-tournament serial queue could process them
- Trigger
During the Agadmator CakeDeFi tournament on 21st December 2021, for the first time players were producing tournament events faster than Lichess could process them. Lichess says it had run larger events before, but with fewer players actively playing at the same moment.
Near: Agadmator CakeDeFi tournament which occurred | Near: players were inputting events faster than Lichess | Near: fewer players actively playing at the same time
- How it failed
A tournament's events are queued and handled strictly one by one to avoid race conditions. The queue kept growing, which delayed pairings, and in the end there was no way to catch up. One tournament's queue cannot be parallelised, so spare capacity elsewhere on Lichess did not help.
Section: Can you elaborate on the technical issue?
- Why defences did not hold
Lichess says the weak point was completely new and unknown to it before the tournament, that earlier tournaments with 30,000+ players had run with no issues, and that simulating events at this scale is not easy. It had some concerns about the initial pairing but was cautiously optimistic that the tournament would continue without issue after it.
Section: Shouldn’t you have known what your infrastructure can support and put limits in place?
- Impact
The tournament had to be cancelled. Lichess itself was not overloaded and the rest of the site kept working without delay.
Near: we had to cancel the tournament | Near: Lichess itself was not overloaded
- Fix
Various changes to the queue code had already been made on the master branch when the post was written; it does not say what they were. In progress: looking at optimisations that empty the queue faster and possibly let some events be processed outside the queue, in parallel. Planned: resume the tournament from the last unaffected standings with the remaining tournament time, depending on agadmator's wishes and the scheduling of top level over-the-board events.
Near: we already made various changes on the master | Near: looking at optimizations that will make the queue | Near: resume the tournament with the last unaffected standings