lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.53k stars 2.27k forks source link

Pairing often takes far too long for no obvious reason #11597

Open JakeQZ opened 2 years ago

JakeQZ commented 2 years ago

Exact URL where the bug happened

https://lichess.org/

Steps to reproduce the bug

  1. Create a private tournament
  2. Have three other players join (using the link you sent them), but don't yet join yourself
  3. Wait until two players start a game
  4. Make sure the third player is not paused and has Lichess open in their browser
  5. Now join the tournament

What did you expect to happen?

Immediate pairing with the third player to start a game.

What happened instead?

Pairing can take several minutes. Sometimes it's quick, as expected, but more often than not it seems to take forever.

Operating system and browser version

Windows 10 Home, 21H1, 19043.2006 Firefox 105.0 (64-bit)

Please note

  1. Lichess has always been mysteriously slow to make obvious tournament pairings, such as that described above. This is not a regression, but something that clearly needs to be improved. There are many other situations in tournaments with a small number of players (4-6) when two (or four) players have just started a game, and there are only two other unpaused players available, neither of whom have just played each other in said tournament, and are both definitely online, ready and not paused; but, apparently, they just have to sit there twiddling their thumbs for several minutes (yes, often at least two minutes) before the system finally decides to pair them.
  2. Such unnecessary delays lead to failed game starts. People give up waiting and start doing something else to kill the time. Then the game starts and they miss the 20 second window to make their first move (see also #11596).
benediktwerner commented 2 years ago

When was the last time you tried it? There already have been some adjustments to small tournaments a few days ago https://github.com/lichess-org/lila/commit/3c0218a10cf1fbea46081b57303d526bab234924.

JakeQZ commented 2 years ago

When was the last time you tried it? There already have been some adjustments to small tournaments a few days ago 3c0218a.

Um, like earlier this evening.

It's been like this all the time I've used this site, which is about two years now.

ornicar commented 2 years ago

What are the tournament settings? Or better, please share URLs of tournaments where that happened

JakeQZ commented 2 years ago

Or better, please share URLs of tournaments where that happened

Definitely happened in this one. We had audio chat on via Jitsi, and the player who missed one game start was busy moaning that he thought he'd been sent to the 'naughty corner', for at least two minutes before the system finally paired him, whereupon he missed the game start yet again because he'd given up staring at a screen.

https://lichess.org/tournament/h22tYPxQ

ornicar commented 2 years ago

several minutes (yes, often at least two minutes)

This is surprising to me as the code says the maximum wait time is 50 seconds for tournaments with slow time controls.

  private val waitSeconds: Int =
    if (clock.estimateTotalSeconds < 30) 8
    else if (clock.estimateTotalSeconds < 60) 10
    else (clock.estimateTotalSeconds / 10 + 6) atMost 50 atLeast 15

Players have to wait so that pairings can be diversified. There could be a special case added about players who have not yet played each other, in small tournaments.