【问题标题】:Google drive api 500 error in 80% of requests on app engine应用引擎上 80% 的请求中出现 Google drive api 500 错误
【发布时间】:2014-01-23 15:57:33
【问题描述】:

我在 Google 应用引擎上使用 Drive API。 应用服务器每天 7k 请求。

在最后一天,来自 api 的错误数量增加到近 60%。

{ "code" : 500, "message" : null }

我使用这段代码来初始化驱动器:

HttpTransport httpTransport = new NetHttpTransport();
        JsonFactory jsonFactory = new JacksonFactory();
        AppIdentityCredential credential =
                new AppIdentityCredential.Builder(Arrays.asList(DriveScopes.DRIVE)).build();
        GoogleClientRequestInitializer keyInitializer =
                new CommonGoogleClientRequestInitializer(Settings.API_KEY);
        Drive service = new Drive.Builder(httpTransport, jsonFactory, null)
                .setHttpRequestInitializer(credential)
                .setApplicationName(APP_NAME)
                .setGoogleClientRequestInitializer(keyInitializer)
                .build();
        return service;

有人有同样的情况吗? 有什么解决办法吗?

谢谢!

更新: 已经开始工作,我这边没有任何改变。

【问题讨论】:

    标签: google-app-engine google-drive-api


    【解决方案1】:

    云端硬盘中存在许多可能导致硬 500 错误的错误,以及许多可能导致这些错误的瞬时内部情况(尤其是超时)。尽可能多地进行研究以区分这两者非常重要,因为有些是永久性的,而有些可能会在退避和重试后成功。

    在您的情况下,我怀疑您是因为 Google 已确认在过去几天影响云端硬盘(可能还有其他服务)的基础架构问题。见https://plus.google.com/106160348960403302854/posts/CwH9SEDTQ4C

    【讨论】:

    • 顺便说一句,使用 Drive 客户端库时要特别小心。我怀疑他们会退避并重试所有 500 个响应,如果出现硬错误,这些响应有时会永远循环。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-18
    • 1970-01-01
    相关资源
    最近更新 更多