OnUpdateGameSession handler function is not invoked when a backfill request is cancelled due to duplicate player ids

Hey, so I came across a situation, not necessarily an issue, that I wanted to make light of. In the case when there is a backfill request, if a new matchmaking request is made involving a player id that is in
the backfill request, then the backfill request gets cancelled. In this case, the OnUpdateGameSession function is not called.

And as far as I know, there are four reasons for why OnUpdateGameSession would be invoked by the GameLift service as found here:

  • MATCHMAKING_DATA_UPDATED – New players were successfully matched to the game session. The GameSession object contains updated matchmaker data, including player data on existing players and newly matched players.
  • BACKFILL_FAILED – The match backfill attempt failed due to an internal error. The GameSession object is unchanged.
  • BACKFILL_TIMED_OUT – The matchmaker failed to find a backfill match within the time limit. The GameSession object is unchanged.
  • BACKFILL_CANCELLED – The match backfill request was canceled by a call to StopMatchmaking (client) or StopMatchBackfill (server). The GameSession object is unchanged.

My question is that should this scenario (backfill request being cancelled due to duplicate player ids being present in another matchmaking request) also invoke the OnUpdateGameSession function under the reason of type BACKFILL_CANCELLED?

Thanks for reading!

@chrisgong OnUpdateGameSession should be called in this case. I have filed a backlog item to address this.

In the meantime, you can implement the following as a workaround:

  1. don’t allow players to submit StartMatchmaking requests while they are in a game
  2. cancel outstanding backfill tickets when a player leaves a game
  3. If backfill is still needed, create a new backfill request with the players that have left not included

OnUpdateGameSession will be invoked when the backfill ticket is explicitly canceled.

1 Like

Hi @Dajun-aws, thank you for the response, I have already implemented your 2nd and 3rd suggestions, but I was wondering for the 1st suggestion, would it be okay to call DescribePlayerSessions with a status filter of β€˜ACTIVE’ to tell if players are in a game or not? The reason I ask is that I have seen in other threads on this forum that DescribeMatchmaking, DescribeGameSessionPlacement, and DescribeGameSessions seem to have throttling limits for when they get called too often. This is discussed in this thread for example. By the way, please correct me if I am wrong because I could only find official documentation supporting the fact that we should not call DescribeMatchmaking too often.

Since I can definitely see a lot of players trying to make matchmaking requests at once, I was wondering if DescribePlayerSessions was subject to this throttling limit rule as well and whether we should limit how often this function gets called.