我们使用 GCP 工作流程通过 http.post
调用每 n 秒执行一些 API 调用以进行状态检查。
一切都很好,直到最近我们的所有工作流程开始因内部错误而失败:
{"message":"ResourceLimitError: Memory usage limit exceeded","tags":["ResourceLimitError"]}
我发现,当我们使用带有查询参数的 GET
时,它的失败发生时间比 POST
和 body 的失败发生得晚一些。
这是测试工作流程:
main:
steps:
- init:
assign:
- i: 0
- body:
foo: 'thisismyhorsemyhorseisamazing'
- doRequest:
call: http.request
args:
url: https://{my-location-and-project-id}.cloudfunctions.net/workflow-test
method: GET
query: ${body}
result: res
- sleepForOneSecond:
call: sys.sleep
args:
seconds: 1
- logCounter:
call: sys.log
args:
text: ${"Iteration - " + string(i)}
severity: INFO
- increaseCounter:
assign:
- i: ${i + 1}
- checkIfFinished:
switch:
- condition: ${i < 500}
next: doRequest
next: returnOutput
- returnOutput:
return: ${res.body}
它最多可以使用 GET 执行 37 个请求,使用 POST 执行最多 32 个请求,然后执行会因错误而停止。而且这个数字不会改变。
仅供引用,Firebase 函数在 POST 和 GET 上返回 200 以及下一个 JSON:
{
"bar": "thisismyhorsemyhorseisamazing",
"fyz": [],
}
你知道哪里出了问题吗?我认为变量的 64Kb 配额没有超出。它不应该被计算为所有作业的总和,不是吗?
最佳答案
这看起来像是产品的问题,我发现了这个 Google tracker ,已报告此问题。
最好通过公共(public)问题跟踪器继续。
关于google-cloud-platform - Google Cloud 工作流程 - 在循环中执行 HTTP 请求时出现 "ResourceLimitError",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66445436/