-
Notifications
You must be signed in to change notification settings - Fork 63
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
RatingService tries to insert journal entry for missing games #658
Comments
Shouldn't this be solved by https://github.com/FAForever/db/blob/develop/migrations/V105__fix_rating_signedness.sql ? |
Yes and no. The problem will still exist if the player stats entries were failed to be created for some other reason. The code here can still be made more robust. |
The issue is that this sub query: game_player_stats_id=select([game_player_stats.c.id]).where(
and_(
game_player_stats.c.playerId == player_id,
game_player_stats.c.gameId == game_id,
)
) could fail, which will then cause the insert statement to fail. But we can already use the rowcount from the previous query to know whether or not this subquery will fail before we try it, so I don't see a reason why we shouldn't check that rowcount. |
I think the root cause of this issue is that sometimes game_player_stats entries fail to get created due to the
mean
column being unsigned and players having negative mean.Source code:
server/server/rating_service/rating_service.py
Lines 269 to 286 in ccf349e
I think we should be checking the rowcount for the
gps_update_sql
statement to see how many rows were affected (hopefully you get this for free with the sqlalchemy ResultProxy object) and if it's 0 then we can break out of this function early, maybe issue a warning.The text was updated successfully, but these errors were encountered: