Google云端硬盘drive.files.get API经常发生HTTP 500内部错误 [英] Frequent HTTP 500 Internal Errors with Google Drive drive.files.get API

查看:63
本文介绍了Google云端硬盘drive.files.get API经常发生HTTP 500内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们提供的服务高度依赖Google云端硬盘(它使用 PythonSDK ),我们的服务将遍历Google云端硬盘集合和文件.

We have a service which is highly dependent on Google Drive (it uses the Python SDK), our service goes through Google Drive collections and files.

检查生产日志后,我们发现在调用Google Drive的 drive.files.get API端点时,存在许多HTTP 500服务器内部错误.错误率约为0.5%.经过调查,我发现极端情况是在一小时内连续发生9个HTTP 500故障.

Checking the production log, we found that there are many HTTP 500 Server Internal Errors when we call Google Drive's drive.files.get API endpoint. The error rate is about 0.5%. After investigating, I found that the extreme case is continuous 9 HTTP 500 failure in one hour.

例外看起来像这样:

  File "/home/xxxxxx/xxxxxxx/storage.py", line 1185, in get_file
    gdrive_file = self.client.files().get(fileId='0Bxn2GmQxR4zHYlNvaUlFNjl6MkE', fields='id,title,modifiedDate,createdDate,fileSize,mimeType,downloadUrl,labels').execute()
  File "/usr/lib/python2.7/dist-packages/apiclient/http.py", line 389, in execute
    raise HttpError(resp, content, self.uri)
HttpError: <HttpError 500 when requesting https://www.googleapis.com/drive/v2/files/0Bxn2GmQxR4zHYlNvaUlFNjl6MkE?fields=id%2Ctitle%2CmodifiedDate%2CcreatedDate%2CfileSize%2CmimeType%2CdownloadUrl%2Clabels&alt=json returned "Internal Error">

我们的服务托管在美国WEST-2数据中心的Amazon Web Service上.

Our service is hosted on Amazon Web Service, in the US WEST-2 data center.

有人有类似的问题吗?感谢您的帮助.

Has anyone had a similar issue? Any help is appreciated.

推荐答案

这与我看到的错误率大致相同.只需执行指数补偿然后重试.

That's approximately the same error rate I see. Just do an exponential backoff and retry.

这篇关于Google云端硬盘drive.files.get API经常发生HTTP 500内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆