【问题标题】:AppEngine Cloud Storage Python library timeout issueAppEngine Cloud Storage Python 库超时问题
【发布时间】:2013-07-20 07:23:55
【问题描述】:

我正在尝试通过任务队列和 20 个后端实例将大量数据从 GCS 迁移到 AppEngine。问题是新的 Cloud Storage 库似乎不遵守 urlfetch 超时,或者发生了其他事情。

import cloudstorage as gcs
gcs.set_default_retry_params(gcs.RetryParams(urlfetch_timeout=60,
                                             max_retry_period=300))
...
with gcs.open(fn, 'r') as fp:
    raw_gcs_file = fp.read()

因此,当队列暂停时,以下工作正常,我一次运行一个任务,但是当我尝试针对 20 个后端运行 20 个并发任务时,以下开始发生:

I 2013-07-20 00:18:16.418 Got exception while contacting GCS. Will retry in 0.2 seconds.
I 2013-07-20 00:18:16.418 Unable to fetch URL: https://storage.googleapis.com/<removed>
I 2013-07-20 00:18:21.553 Got exception while contacting GCS. Will retry in 0.4 seconds.
I 2013-07-20 00:18:21.554 Unable to fetch URL: https://storage.googleapis.com/<removed>
I 2013-07-20 00:18:25.728 Got exception while contacting GCS. Will retry in 0.8 seconds.
I 2013-07-20 00:18:25.728 Unable to fetch URL: https://storage.googleapis.com/<removed>
I 2013-07-20 00:18:31.428 Got exception while contacting GCS. Will retry in 1.6 seconds.
I 2013-07-20 00:18:31.428 Unable to fetch URL: https://storage.googleapis.com/<removed>
I 2013-07-20 00:18:34.301 Got exception while contacting GCS. Will retry in -1 seconds.
I 2013-07-20 00:18:34.301 Unable to fetch URL: https://storage.googleapis.com/<removed>
I 2013-07-20 00:18:34.301 Urlfetch retry 5 failed after 22.8741798401 seconds total

22 秒后怎么会失败?它似乎根本没有使用重试参数。

【问题讨论】:

  • 现在,我可以通过将截止时间参数强制为 90(秒)来快速完成对 cloudstorage/storage_api.py:do_request_async() 的破解工作。运行 20 个后端时,事情仍然会出错/超时,但比以前少得多。稍后我将不得不进一步探索。

标签: python google-app-engine google-cloud-storage


【解决方案1】:

这是 gcs 客户端库中的一个错误。很快就会修复。谢谢!

你 hack 会起作用的。但是如果还是经常超时,可以尝试做fp.read(size=some_size)。如果您的文件很大,响应为 32 MB(URLfetch 响应大小限制)和 90 秒的最后期限,我们假设传输速率为 364KB/s。

【讨论】:

  • 这需要尽快修复。推动人们迁移到 GCS 客户端库并远离类似文件的 blobstore 以及带有严重错误的库是不可接受的。
猜你喜欢
  • 1970-01-01
  • 2021-01-21
  • 2014-01-05
  • 1970-01-01
  • 2012-11-16
  • 2016-01-19
  • 1970-01-01
  • 2020-03-04
  • 2013-01-09
相关资源
最近更新 更多