Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various leaderboard data races #2408

merged 6 commits into from Apr 18, 2018


Copy link

@smoogipoo smoogipoo commented Apr 16, 2018

Fixes #2327, fixes #1859.

I'll explain this in order of commits. For these explanations to take place consider the following situation:

Beatmap A : Ranked      <- Selected
Beatmap B : Unranked
Beatmap C : Ranked


Scores are loaded on background threads, either through LoadComponentAsync or through webrequest results.

  • When switching A -> B or C -> B, it was possible to set the scores to prior to the Schedule inside Scores_set being run.
  • When switching rapidly between A/B or B/C, it may be possible to get into a state where both the unavailable placeholder and scores were visible. This is likewise due to the presence of the Schedule.


When switching from Unranked -> Ranked -> Unranked beatmap (e.g. A -> B -> C -> B), leaving no more than 150ms between switches:

  • B will set the placeholder to Unavailable.
  • C will fadeout the placeholder and then expire it.
  • Since the placeholder isn't expired yet, it'll still be in the container, and the check if (placeholder.Equals(currentPlaceholder)) return; will succeed, where the placeholder is in the process of expiring.

Copy link
Contributor Author

Latest changes look fine to me.

@peppy peppy merged commit 2b83d49 into ppy:master Apr 18, 2018
@smoogipoo smoogipoo deleted the fix-leaderboard-nullref branch June 15, 2018 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Leaderboard hard crash on beatmap switch Leaderboard shows Placeholder and Scores together (or neither)
2 participants