Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by ToanNguyen · Oct 25, 2018 at 03:30 PM ·

Timeout on cloudscript, how to prevent it?

Hi.

Because playfab doesnt have API for getting list guild so im using Google Cloud SQL for interact and manager Guild List.

But i got trouble with TIMEOUT error, example below will describe a case when i try to create a guild and insert few data on Cloud SQL. The first part is okay (guild has been created on Playfab) but timeout when connect to Cloud SQL. I 've checked connection to Cloud SQL and it always be good and respond always less than 1 second.

It happens 1 time per 2-3 requests (including get list guild from google cloud via cloud script)

Log from result.Log:

"{\"url\":\"https://spacex-xxxx.appspot.com/guild/InsertGuild?id=8AB186B989316CF9&name=Super marine&member=1&point=0®ion=VN&logo=6&maxMember=20&key=playfab151\",\"result\":{\"responseContent\":null,\"httpStatus\":null,\"httpStatusCode\":0,\"requestError\":\"Timeout\"},\"httpRequestError\":\"Timeout\"}"

Bonus: that guild has been created on cloud sql but still time out on the log.

Cloud script code:

var GetGuild_flink = "https://spacex-xxxx.appspot.com/guild/";
// google cloud SQL (create for searching + ranking)

var url = GetGuild_flink + "InsertGuild" + "?id=" + result.Group.Id + "&name=" + args.GuildName + "&member=" + "1" + "&point=" + "0" + "®ion=" + "VN" + "&logo=" + args.Logo + "&maxMember=" + 20 + "&key=playfab151";

var response = http.request(url);           
// send log to client
var message = result.Group.Id;
log.info(message);
return {messageValue: message};

Limit for execution of cloud script is 4.5 seconds so i think it shouldnt happen too much

How can i prevent it and how to know the reason?, because i got "can not solve destination host when login on Playfab" and i dont know how to get respond time from external API on cloud script.

Thank you for helping me.

Comment

People who like this

0 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

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Jay Zuo · Oct 26, 2018 at 01:43 AM

Although the limit for execution of cloud script is 4.5 seconds, the http.request call timeout is 2.5 seconds. If Cloud SQL service does not return within that period, the call will timeout, causing the script to fail. For more info, please see @Brendan's answer here: https://community.playfab.com/comments/24032/view.html.

I'm afraid there is no good way to prevent it as google cloud SQL needs time to perform query and that's not something we can control. You can contact sales team (sales@playfab.com) to discuss an Enterprise tier agreement with a longer timeout. And also check the Entity Groups document which is PlayFab's build in solution for Guilds.

Comment

People who like this

0 Show 2 · 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 ToanNguyen · Oct 26, 2018 at 02:32 AM 0
Share

thank you for your reply, we are solving this issue and maybe we will contact to sale team to upgrade our tier.

avatar image Andy ♦♦ ToanNguyen · Oct 26, 2018 at 03:26 AM 0
Share

Depending on your game's timeline, we may have a solution for you in the near future. In the next major update to the entities system, we're planning on adding a group search API. I don't have more details to share right now, but it should directly address your current requirements.

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

    3 People are following this question.

    avatar image avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

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

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges