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

Skip score uploads when nothing was hit in score #224

Merged
merged 1 commit into from Mar 14, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Mar 14, 2024

RFC.

The client will not submit a play if hit statistics indicate that they never hit anything.

This check was not exercised spectator server-side, which meant that scores with nothing hit would get completed and enqueued for upload that would never succeed (because the score would never be submitted anyway). To save on some processing, just port the same check server-side to skip upload if nothing was hit.

I'm hoping the effects of this is going to be the decrease of the score timeouts monitoring on sentry & datadog closer to real levels (see discussion in #220).

The client will not submit a play if hit statistics indicate that they
never hit anything:

	https://github.com/ppy/osu/blob/a47ccb8edd2392258b6b7e176b222a9ecd511fc0/osu.Game/Screens/Play/SubmittingPlayer.cs#L281

This check was not exercised spectator server-side, which meant that
scores with nothing hit would get completed and enqueued for upload that
would never succeed (because the score would never be submitted anyway).
To save on some processing, just port the same check server-side to skip
upload if nothing was hit.

I'm hoping the effects of this is going to be the decrease of the score
timeouts monitoring on sentry & datadog closer to real levels (see
discussion in ppy#220).
Comment on lines +150 to +151
// note that this isn't an early return as we still want to end the play session.
// see: https://github.com/ppy/osu/blob/a47ccb8edd2392258b6b7e176b222a9ecd511fc0/osu.Game/Screens/Play/SubmittingPlayer.cs#L281
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand what this comment means by "end the play session" - there's nothing running after the block other than the finally, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is actually:

await endPlaySession(Context.GetUserId(), state);

Skipping that causes a test to fail. I considered moving that call inside finally but wasn't convinced that was correct.

Copy link
Contributor

@smoogipoo smoogipoo Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it was hidden. How come that isn't an issue for the above return? Something somewhere (osu-web?) blocks it from starting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand this one skipping it:

// Score may be null if the BeginPlaySession call failed but the client is still sending frame data.
// For now it's safe to drop these frames.
if (score == null || scoreToken == null)
return;

because it assumes that BeginPlaySession() failed. But I don't understand this one:

// Do nothing with scores on unranked beatmaps.
var status = score.ScoreInfo.BeatmapInfo!.Status;
if (status < min_beatmap_status_for_replays || status > max_beatmap_status_for_replays)
return;

I think that may be an actual bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm okay. That second one is the one I was referring to specifically. I think this is fine to get in as-is but that should probably be investigated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm looking at it.

@smoogipoo smoogipoo merged commit 1c622f6 into ppy:master Mar 14, 2024
2 checks passed
@bdach bdach deleted the skip-upload-scores-without-hits branch March 14, 2024 10:13
bdach added a commit to bdach/osu-server-spectator that referenced this pull request Mar 14, 2024
…ranked beatmap plays

As discussed in
ppy#224 (comment).

In full-stack testing, this manifests as an actual bug wherein when
spectating a player who's playing an unranked beatmap, spectator player
will not exit even when the spectated player is done playing and will
hang there forevermore.
bdach added a commit to bdach/osu-server-spectator that referenced this pull request Mar 14, 2024
…ranked beatmap plays

As discussed in
ppy#224 (comment).

In full-stack testing, this manifests as an actual bug wherein when
spectating a player who's playing an unranked beatmap, spectator player
will not exit even when the spectated player is done playing and will
hang there forevermore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants