error 204 in a Google App Engine API in java

人走茶凉 提交于 2020-01-15 06:36:20

问题


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???


回答1:


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.



来源:https://stackoverflow.com/questions/31365235/error-204-in-a-google-app-engine-api-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!