AppEngine Java: The API call file.Create() took to

2019-05-30 16:17发布

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?

The complete stacktrace is:

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)

Thanks!

1条回答
爷的心禁止访问
2楼-- · 2019-05-30 16:48

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.

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.

查看更多
登录 后发表回答