Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

http - Google Calendar REST API returns 503 when adding very large group (20k+ member) as invitee

We're using Google Calendar as part of GSuite for organization.

The current organization administrator has created a new google group (groups.google.com) that contains the entire member of the organization (20k+ member) called [email protected] (name changed for privacy).

When making new event through Google Calendar web ( https://calendar.google.com/calendar/u/0/r/ ), it seems that adding that group to invitee makes the "saving" process very slow (can be one minute), and for the event to appear in member's calendar took longer (can be 2-10 minutes), this is still acceptable since we're talking about large number of user. But now, we're tasked to make a managed calendar web application that may add/edit/delete events programmatically (so we used Google REST Calendar API v3 https://developers.google.com/calendar/v3/reference/events ).

While developing said app, we encountered problem that the API endpoint is very slow (runs for 1min 0.54sec), and then returns "status 503" / "The service is currently unavailable" / "backendError". But 2-10 minutes later, the event appeared in Google Calendar (as if the HTTP REST API call was a success).

This is unacceptable since our app needs to read the API return to save eventId to our database. We need that eventId for editing/deleting said event programatically.

Please see attached picture for postman screenshot.

Is there any solution to make Google Calendar REST API for event resource to work with very large groups without error?

It's just my speculation, but is Google REST API's HTTP server set to automatically timeout at 1 minute and return 503? As I tried sending an exactly same HTTP request with empty "attendees": [], it returns 200 and have expected response body.

HTTP request that works:

POST https://www.googleapis.com/calendar/v3/calendars/primary/events
Authorization: Bearer ***************

{
    "description": "Test 17-10",
    "sequence": 0,
    "summary": "Test 17-10",
    "location": null,
    "end": 
    {
        "timeZone": "Asia/Jakarta",
        "dateTime": "2020-10-17T09:00:00+07:00"
    },
    "start": 
    {
        "timeZone": "Asia/Jakarta",
        "dateTime": "2020-10-17T09:00:00+07:00"
    },
    "reminders": { "useDefault": true },
    "attendees": []
}

response: expected response (return event resource representation as described in https://developers.google.com/calendar/v3/reference/events )

HTTP request that DO NOT work:

POST https://www.googleapis.com/calendar/v3/calendars/primary/events
Authorization: Bearer ***************

{
    "description": "Test 17-10",
    "sequence": 0,
    "summary": "Test 17-10",
    "location": null,
    "end": 
    {
        "timeZone": "Asia/Jakarta",
        "dateTime": "2020-10-17T09:00:00+07:00"
    },
    "start": 
    {
        "timeZone": "Asia/Jakarta",
        "dateTime": "2020-10-17T09:00:00+07:00"
    },
    "reminders": { "useDefault": true },
    "attendees": [ {"email":"[email protected]"} ]
}

response:

{
    "error": {
        "code": 503,
        "message": "The service is currently unavailable.",
        "errors": [
            {
                "message": "The service is currently unavailable.",
                "domain": "global",
                "reason": "backendError"
            }
        ],
        "status": "UNAVAILABLE"
    }
}

enter image description here

Edit: I'm reporting this to google's issue tracker: https://issuetracker.google.com/issues/177013453


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...