question

robert avatar image
robert asked

Concurrent edit error between UpdateUserReadOnlyData and UpdateUserInternalData?

Hi guys, We have a small problem and hope we can get some insights (We ported in the meantime 100% of the cloudscript code to azure, approx. 25000 LOC, everything fine, except this issue)

When a new user is created, right after logging in, we setup the user account from an azure function.

We perform 4 read requests concurrently, then build our internal data and then make 3 write requests concurrently (UpdateUserReadOnlyData, UpdateUserInternalData, UpdatePlayerStatistics). Nothing else is happening, but in approx. 40% of the cases we receive a concurrent edit error (sometimes as result for UpdateUserReadOnlyData, sometimes as result for UpdateUserInternalData)

The screenshot shows network capture where it clearly shows that no additional calls are performed (also not from the client) All keys in both UpdateUserData requests are unique Maybe I'm wrong, but it should be allowed to call UpdateUserReadOnlyData and UpdateUserInternalData at the same time?

All calls are made with a static single instanced PlayFabServerInstanceApi

image-47.png (389.0 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image
Rick Chen answered

The ConcurrentEditError indicates too many simultaneous calls or very rapid sequential calls. You could apply a exponential retry strategy for these calls that may fail. And you may aggregate your API calls into fewer calls. For example, if your read requests read the player’s UserData, UserReadOnlyData, PlayerStatistics, you could use the GetPlayerCombinedInfo API instead.

Please also note that the newly created player account will have a profile creation process in the backend, it is recommended to have a few seconds delay before profiles read/write APIs are called.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robert avatar image
robert answered

We definitely don't make too many simultaneous call as you see in the network log above.

Unfortunately this is not really a answer which helps us, what is the exact issue leading to this 409 in this exact situation? Should we better open a ticket?

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

I noticed that you have created a ticket, we will continue supporting you on that ticket. Thanks for your understanding.

0 Likes 0 ·
Kaiwen Yu avatar image Kaiwen Yu commented ·

I am having the same issue. Could you please show how it is resolved?

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Kaiwen Yu commented ·

According to the corresponding team, it’s not possible to make multiple concurrent calls to update different pieces of user data for a single player as the update call updates the entire user profile. This is a technical limitation of the profile update APIs. You could apply a exponential retry strategy in your code as mentioned above.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.