• Sign Up Login
  • Features
    • Game Services
    • Real-time Analytics
    • LiveOps
    • Add-ons
  • Game Services
  • Real-time Analytics
  • LiveOps
  • Add-ons
  • Games
  • Pricing
  • Blog
  • Support
    • Docs
    • Forums
    • Contact
  • Docs
  • Forums
  • Contact
  • Sign Up Login
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by Ben · Oct 22 at 03:37 AM · apisCloudScriptsupport

Request timeout

I've been trying to track down a bug with our game for a while now, but I've hit a wall. We rely on the resolution of a PlayFab login before we finish our startup initialization. One of the things we use PlayFab for is storing some configuration in the title data, so knowing if we're logged in and that we can access that data is critical.

My problem is that some of the requests to PlayFab are taking a confusing amount of time (40+ seconds). Primarily the login request, since that's what blocks the initialization of the game, but I have also noticed it on some cloudscript execution requests. We added our own "Timeout" which is just a co-routine that retries the request after ~20 seconds, which reduced the number of tickets we received. However, many users fail 3+ times without a single response from the API.

Where would you suggest that I go from here?


I would assume it's a timeout issue, but other questions on the forums state that the timeout is 2.5 seconds, which would be greatly exceeded here. Could it be the PlayFab `RequestKeepAlive` setting keeping the request from timing out, but then the request still taking over a minute to reply?

We're using unity 2018.3.14f1, with the PlayFab sdk 2.75.191001, our TitleID is 713F0


Our PlayFab settings are configured to use:
`RequestType: UnityWebRequest`,
`RequestTimeout: 2000`,
`RequestKeepAlive: true`,
`CompressApiData: true`

Frustratingly I cannot recreate this delay on my own machine, it only happens to users while on mobile devices. It doesn't seem specific to Android or iOS as I get user reports for both. We include unity's NetworkReachability in the support ticket, and devices are reporting `ReachableViaLocalAreaNetwork` and `ReachableViaCarrierDataNetwork`


Any help is greatly appreciated, thanks in advance!

Comment
Citrus Yan

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Oct 22 at 08:49 AM

Hi @Ben,

>>Where would you suggest that I go from here?

You are saying that the requests to PlayFab takes a confusing amount of time (40 + seconds), do you mean that PlayFab responded properly (without raising TimeOut error) although it took about 40 + seconds? If that’s the case, as I see it, 40+ seconds greatly exceeds the Time Out (2s based on your configuration). I think you should utilize network capture tools such as fiddler to help track the network traffic to see whether it actually took 40+ seconds for the responses to reach the Client.

>>…Could it be the PlayFab `RequestKeepAlive` setting keeping the request from timing out, but then the request still taking over a minute to reply?

No, I don’t think so. According to this code, RequestKeepAlive refers to the Keep-Alive Http general header, which allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests. Therefore, it’s unlikely that PlayFab `RequestKeepAlive` setting keeping the request from timing out while the request still taking over a minute to reply.

By the way, I looked into your title’s API CALLs from the Title Overview page, the results of login calls seem alright though. You may need to add more loggings in the client-side to help identify the issue.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Ben · Oct 24 at 07:47 PM

Thank you @Citrus Yan for your quick response!


Unfortunately I haven't been able to reproduce the issue on any of my devices, so I think it's unlikely that a network capture tool such as fiddler will help me identify the issue. Though it's certainly something I'll look into!


I plan on releasing a new build with some additional logging. Mainly by setting EnableRequestTimes to true, and logging the output to console as well. I had read that this is not the best to have running in production, but it feels like a necessary evil at this point.

I'm hoping that this gives me enough extra information that I can resolve the issue, as I continue to get support tickets on a daily basis.

As a side note, I have noticed that the issues are more prominent when trying to log in using a DeviceID instead of a social backend such as GameCenter or GPGS.



Another question that you might be able to answer for me is the impact of multiple login calls?

In out current setup we make a login request, and if in 20 seconds the request has not returned we make another attempt. However if the first request returns after that time we discard it, regardless of the result. This is done by sending a generated id as custom data with the request.

Would there be a negative impact to accepting a successful request for login despite having potentially already sent additional requests?

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Citrus Yan ♦ · Oct 25 at 03:30 AM 0
Share

Hi @Ben

Not really, technically speaking, login calls are just a way of authenticating players so that they can make subsequent API calls. The players can make subsequent calls as long as they have one of the SessionTicket received from those login calls, making multiple login calls won't affect much.

avatar image

Answer by andrestallos · Dec 02 at 07:35 PM

Hello! We seem to be having a similar problem. In particular, we seem to be having no response on the LoginWithIOSDeviceID call. We have seen a few cases, always on iPad devices (not on iPhone on in Android devices with LoginWithAndroidDeviceID). Unfortunately one of those devices is used by Apple for their review process, so we’ve had several rejections now because the device fails to create an account and gets stuck waiting for an answer. We are not 100% sure if it fails consistently with those devices or only occasionally, because we haven’t seem them try multiple times (since this happens on their very first session, it isn’t odd that they don’t come back). Unfortunately we haven’t been able to reproduce the problem on our own test devices.

We are certain that the call reaches the server, because the account is created, leaving the usual traces in the player's Event History. However, we are also quite certain that device doesn’t receive a response from the server, because Apple sends a screenshot of the state in which the game waits too long, and we’ve set it up to show a different message in each step of the login flow, including right before and after the Playfab call.

We are using Unity 2019.2.9f1 and version 2.76.191015 of the Playfab SDK. The other main plugins are Firebase, Photon and Adjust. Our Playfab settings use Unity Web Request, Request Timeout: 2000, Keep Alive: True, Compress API Data: True. Our TitleId is AE2C. We can send the playerId of specific cases we've found of accounts having this error.

Is there anything we could do to try to get around this, or to debug it further? We think we may have had this error occasionally before, but it seems to have become more frequent now. It is preventing us from getting new updates approved by Apple, so it's a serious blocker at the moment. Any help would be really appreciated!

Comment
marcospaulis
andrestallos

People who like this

2 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    GetPlayerCombinedInfoRequest no longer includes DisplayName in response 2 Answers

    Item provides not happening even after using Playfab payment API 0 Answers

    TypeError when trying to declare a call to server.GetPlayersInSegment(); 1 Answer

    CloudScript Handler to get player IDs from segment often returns Internal Server Error 1 Answer

    JSON Field Reformatting on Automation Save 2 Answers

    • PlayFab

      • Features
      • Games
      • Pricing
      • Blog
    • Engineers

      • Documentation
      • Quickstarts
      • API Reference
      • SDKs
      • Usage Limits
    • Support

      • Forums
      • Videos
      • Contact
      • Service Health
      • Terms of Service
    • Social

      • Facebook
      • Twitter
      • LinkedIn
      • YouTube
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • About Microsoft
    • Jobs
    • Accessibility
    • Diversity & inclusion
    • Security
    • Company news
    • © Microsoft 2019
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges