Set_keepalive alway return "closed while sending to client"
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- lua, nginx
- 领域
- networking
调研方向
首先复现所示的 OpenResty 配置,并跟踪 httpc:request_uri 调用经过 httpc:set_keepalive 的过程。检查报告的“closed while sending to client”响应,并确定 keepalive 失败的条件;确认了原因并提供适合项目的修复方案或记录在案的解决方案后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
We plan to use Lua code blocks to call external services to record some logs in Nginx services, But the pressure test found poor performance and high latency.
I found that http.set_keepalive has error response and keepalive is not taking effect. I have pasted some code as follow, could you please help me analyze it?
Error response:
*1375 [lua] content_by_lua(nginx.conf:97):27: failed to set keepalive: closed while sending to client, client: 192.168.71.11, server: _, request: "POST /v2/models/aiml_model/infer HTTP/1.1", host: "aiplatform.dev51.cbf.dev.paypalinc.com-shadow"
`
location / {
mirror /mirror1;
resolver 192.168.36.10 valid=10s;
proxy_pass http://backends;
proxy_method $request_method;
mirror_request_body on;
proxy_pass_request_body on;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
content_by_lua_block {
local http = require "resty.http"
local ngx_log = ngx.log
local ngx_ERR = ngx.ERR
local httpc = http.new()
httpc:set_timeout(5000)
local url = "https://aiplatform.dev52.cbf.dev.paypalinc.com/bizlogging/insert?model_id=model_id"
local body = '{"metadata_schema": ["request_body"],"variable_schema": ["response_body"]}'
local headers = {
["Content-Type"] = "application/json",
["accept"] = "*/*",
}
local res, err = httpc:request_uri(url, {
method = "POST",
body = body,
headers = headers,
ssl_verify = false,
timeout = 1000,
})
ngx_log(ngx_ERR, "success to request: ", res.status)
local ok, err1 = httpc:set_keepalive(60000, 100)
if not ok then
ngx_log(ngx_ERR, "failed to set keepalive: ", err1)
end
}
}`
- 主要语言
- Lua
- 星标
- 2.1k
- 派生
- 630
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ledgetech/lua-resty-http 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 75/100
ledgetech/lua-resty-http#337 ·
-
难度 4/5 3-5 天 新手友好度 35/100
ledgetech/lua-resty-http#334 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
ledgetech/lua-resty-http#330 ·
-
难度 4/5 3-5 天 新手友好度 15/100
ledgetech/lua-resty-http#325 ·
-
难度 4/5 3-5 天 新手友好度 35/100
ledgetech/lua-resty-http#324 ·
查看 ledgetech/lua-resty-http 的全部 Issue
相似的 Issue
-
Lid close does not lock the session on Apple Silicon (lid-close bind skips omarchy-system-lid-close)未关闭
难度 1/5 1-3 小时 新手友好度 90/100
omacom/omarchy-mac#701 · 1 条评论 ·
维护者通常 1 天内回复
-
import-issue
难度 2/5 1-3 小时 新手友好度 64/100
public-transport/transitous#2553 ·
维护者通常 1 天内回复
-
BUG: `utils.job` never closes the process handle, leaking every job's output可能已有人在做 @mattlibera 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
nvim-neo-tree/neo-tree.nvim#2105 ·
-
Bug Forever Module - Map / Minimap
难度 2/5 1-3 小时 新手友好度 68/100
Questie/Questie#7997 · 2 条评论 ·
维护者通常 1 天内回复
-
agent-butler-finding chore
难度 1/5 1 小时以内 新手友好度 88/100
codymikol/multiverse.nvim#384 ·
维护者通常 1 天内回复