gpt4 book ai didi

java - Java 中的 Google App Engine API 中的错误 204

转载 作者:行者123 更新时间:2023-11-30 08:10:59 26 4
gpt4 key购买 nike

我们有一个用于 Googe App Engine 的 API。 API 包含在搜索引擎上,当用户请求 productID 时,API 返回带有一组其他 productID(具有特定条件)的 json。这是当前配置:

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

我们使用 app_engine_release=1.9.23

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

问题在于我们不时收到带有此跟踪的 en error 204:

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)

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

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

我们将常驻实例的数量从 3 更改为 7,但我们得到了同样的错误。错误也发生在相同的实例中。我们在很短的时间内看到了 4 个错误。

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

知道为什么会这样吗???

最佳答案

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

我为消除错误所做的工作是从 Google 中删除云端点并使用基本的 servlet。我发现将 servlet 与 urlfetch 调用混合我们不会收到错误,因此问题可能不仅与 urlfetch 有关,而且与 urlfetch 和 Google 云端点的组合有关。

关于java - Java 中的 Google App Engine API 中的错误 204,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31365235/

26 4 0
文章推荐: java - 将 String、ArrayList 等对象添加到 List