AppEngine Java:API调用file.Create()花了太长时间才响应并被取消 [英] AppEngine Java: The API call file.Create() took too long to respond and was cancelled

查看:565
本文介绍了AppEngine Java:API调用file.Create()花了太长时间才响应并被取消的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在尝试将文件写入Blobstore时会遇到此异常。它通常出现一两分钟,然后一切恢复正常。
已在 http://code.google.com/上报告p / googleappengine / issues / detail?id = 5723
但标记为已关闭。

we're getting this exception sometimes when trying to write a file to the Blobstore. It usually appears for one or two minutes and then everything gets back to normal again. It's reported on http://code.google.com/p/googleappengine/issues/detail?id=5723 but marked as closed.

你们经历过这样的事吗?

Do you guys experienced anything like this?

完整的堆栈跟踪是:

com.google.apphosting.api.ApiProxy$ApiDeadlineExceededException: The API call file.Create() took too long to respond and was cancelled.
at java.lang.Thread.getStackTrace(Thread.java:1495)
at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:218)
at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:67)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:163)
at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:161)
at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:67)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:101)
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:50)
at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServiceImpl.java:557)
at com.google.appengine.api.files.FileServiceImpl.create(FileServiceImpl.java:479)
at com.google.appengine.api.files.FileServiceImpl.createNewBlobFile(FileServiceImpl.java:99)
at com.google.appengine.api.files.FileServiceImpl.createNewBlobFile(FileServiceImpl.java:81)
at ar.com.zupcat.lib.util.BlogstoreUtil.saveToBlogstoreImpl(BlogstoreUtil.java:69)

谢谢!

推荐答案

DeadlineExceededExceptions总是偶尔发生。

It's always possible for DeadlineExceededExceptions to occur sporadically.

您应该始终编写代码来处理这些类型的瞬态错误,最有可能是在短暂延迟后重试请求。

You should always be writing your code to deal with these types of transient errors, most probably by retrying the request after a short delay if possible.

值得指出的是,文件API仍然是实验性的,我们会继续改进它的性能和可靠性 - 但你仍然应该采取防御性的代码。

It's worthwhile pointing out that the files API is still experimental and we continue to make improvements to it's performance and reliability - but you should still code defensively.

这篇关于AppEngine Java:API调用file.Create()花了太长时间才响应并被取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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