by Janzert » Tue Nov 30, 2010 3:17 am
This is certainly cause for concern, in fact if you look at the pairing code in create_matchups.py the highest priority in map choice is to prevent this from happening. This is of course because the same two players on the same map will almost always or at least very, very frequently give the same outcome and would lead to distortion of the rankings.
After a few false starts in direction for what could be causing this (isn't debugging fun, fun, fun) here is what seems to have happened.
In case you're aren't familiar with how the overall system works for getting from pairing a player to having the result in the database here is a quick high level overview. The process starts in create_matchups.py where the specific pairing and map to play is chosen, it then inserts these matchups into a queue in the database. Generally a few minutes worth of matches are generated in a batch. The worker instances then request matches and they are handed out from this queue. At the time they are handed out they are timestamped in the queue but not removed. When the game finishes on the worker it then turns it back in, the result is recorded and the match is removed from the queue. The match can't be immediately removed from the queue for two reasons. First so that if the pairing script runs while the game is in progress it doesn't think the players are most deserving of a game and immediately schedule them again. Second if the worker crashes while the game is in progress it needs to be rescheduled. So if the game has been handed out but not turned back in for a certain amount of time the server will hand it back out again.
That last part is where the problem came in. The time limit to hand out a game that hadn't been turned back in was set at 6 minutes. This would seem safe since games can only go for 3 minutes and 20 seconds. Unfortunately it appears very rarely something happens that delays the game being turned in for several minutes, I don't know what specifically causes.
All that is to say that there have been 5 matchups that were played twice. As would be expected every repetition resulted in the same player winning both times. In order to prevent it from occurring anymore my first quick path was to increase the time limit before handing a match back out to 15 minutes. I then also implemented a check when recording a game result to check that the particular pairing and map haven't already been played.
To eliminate whatever small distortion is introduced by the repeat games I'll also move the repeats out of the rankings.
Janzert