java中的Google App Engine API中的错误204 [英] error 204 in a Google App Engine API in java

查看:211
本文介绍了java中的Google App Engine API中的错误204的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Googe App Engine的API。 API由搜索引擎组成,当用户请求产品ID时,API返回带有一组其他产品ID(具有特定标准)的json。这是当前配置:

 < instance-class> F4_1G< / instance-class> 
<自动缩放>
< min-idle-instances> 3< / min-idle-instances>
< max-idle-instances>自动< / max-idle-instances>
自动< / min-pending-latency>
<最大等待时间>自动< /最大等待时间>
< /自动缩放>

我们使用app_engine_release = 1.9.23



该过程如下。我们有两个对数据存储的调用和一个使用urlfetch(对外部API)的调用。



问题在于,我们不时会收到错误204的跟踪信息:


ms = 594 cpu_ms = 0 exit_code = 204 app_engine_release = 1.9.23
处理此请求的进程遇到问题,导致它退出。这很可能会导致下一个请求应用程序使用新的进程。 (错误代码204)

这就是我们在客户端得到的结果:



< pre $ {
error:{
errors:[
{
domain:global,
reason:backendError,
message:
}
],
code:503,
message:
}
}

我们将驻留实例的数量从3改为7我们得到了同样的错误。此外,错误也发生在相同的情况下。我们会在很短的时间内看到4个错误。



我们发现问题出在urlfecth调用。如果我们提出高超时,那么它会返回很多错误。



任何想法为什么发生这种情况?

解决方案

我相信我找到了问题。问题与urlfetch调用有关。我做了很多测试,直到我找出问题。当我只对数据存储进行调用时,一切都按预期工作。但是,当我添加urlfetch调用它产生了204错误。它经常发生,所以我相信这可能是一个错误。

我为了摆脱这个错误而做的是从Google中删除云端点并使用一个基本的servlet。我发现将servlet与urlfetch调用混合在一起,我们不会得到错误,因此问题可能不仅与urlfetch相关,而且与urlfetch和Google云端点的组合相关。

We have an API with Googe App Engine. The API consist on a search engine, when a user requests a productID the API returns a json with a group of other productIDs (with a specific criteria). This is the current configuration:

<instance-class>F4_1G</instance-class>
<automatic-scaling>
<min-idle-instances>3</min-idle-instances>
<max-idle-instances>automatic</max-idle-instances>
<min-pending-latency>automatic</min-pending-latency>
<max-pending-latency>automatic</max-pending-latency>    
</automatic-scaling>

We use app_engine_release=1.9.23

The process does as follows. We have two calls to datastore and a call with urlfetch (to an external API).

The problem consist on that from time to time we receive en error 204 with this trace:

ms=594 cpu_ms=0 exit_code=204 app_engine_release=1.9.23 A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)

This is what we got in the client:

{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": ""
}
],
"code": 503,
"message": ""
}
}

We changed the number of resident instances from 3 to 7 and we got the same error. Also the errors occur in the same instances. We see 4 errors within a very small amount of time.

We found that the problem was with the urlfecth call. If we put a high timeout, then it returns a lot of errors.

any idea why this is happening???

解决方案

I believe I have found the problem. The problem was related to the urlfetch call. I did many tests until I isolate the problem. When i did calls only to datastore everything worked as expected. However when I added the urlfetch call it produced the 204 errors. It happened always so I believe that could be a bug.

What I did to get rid of the error was to remove the cloud end point from Google and use a basic servlet. I found that mixing the servlet with the urlfetch call we don't get the error, therefore the problem might not be only related to urlfetch but a combination of urlfetch and Google cloud end point.

这篇关于java中的Google App Engine API中的错误204的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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