WebSocket: backend request left open when the client leaves before the upgrade completes
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- backend, networking
调研方向
Start with the WebSocket branch of ReverseProxy.Proxy#sendRequest, which calls request.connect() without setting a reset handler, and compare it with ProxiedRequest#sendRequest, which resets the backend request from the client response's exception handler. Then read ReverseProxy.Proxy#sendResponse where the 101 failure branch prints 'Handle this case'. The two tests named in WebSocketTest in PR #156 are the reproducers; the work is done when both pass and the backend socket closes after the client leaves. PR #156 is already open, so check it before starting.
由索引模型根据 Issue 内容生成。
描述
Version
5.2.1 (also current main)
Context
The client and backend sockets of a proxied WebSocket are only joined in ReverseProxy.Proxy#sendResponse once the
backend answers 101. Nothing watches the client connection before that, so a client that goes away during the
upgrade leaves the request to the backend open:
- Backend has not answered yet: the backend connection stays open for as long as the backend does not answer
(indefinitely for a backend that never answers). - Backend answers 101 after the client left:
proxiedRequest().toNetSocket()fails, the failure branch prints
Handle this caseand a stack trace toSystem.err, and the backend socket is never closed. - Client already gone when the origin is resolved (e.g. an
OriginRequestProviderdoing an async lookup): the
upgrade is still sent to the backend.
Proxied HTTP requests do not have this problem: ProxiedRequest#sendRequest resets the backend request from the
client response's exception handler. The WebSocket branch in ReverseProxy.Proxy#sendRequest calls
request.connect() directly and does not set it.
Steps to reproduce
- Proxy to a backend that reads the upgrade request and never answers.
- Send a WebSocket upgrade through the proxy, then close the client connection.
- The backend connection is never closed.
Do you have a reproducer?
Yes, two tests in WebSocketTest in the linked PR; both fail on main (the first by timing out, the second with the
upgrade reaching the backend).
- 主要语言
- Java
- 星标
- 68
- 派生
- 39
- 平均合并
- 2 天 43 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-vertx/vertx-http-proxy 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 4/5 3-5 天 新手友好度 56/100
-
bug
难度 3/5 1-2 天 新手友好度 68/100
-
ExceptionHandler for send requests and proxy responses in `HttpProxy`/`ReverseProxy`可能重新可做 @tsegismont 于 575 天前认领,目前没有进行中的 PR。 未关闭enhancement
eclipse-vertx/vertx-http-proxy#114 · 2 条评论 · 已指派 1 人 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 30/100
eclipse-vertx/vertx-http-proxy#109 · 5 条评论 ·
查看 eclipse-vertx/vertx-http-proxy 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
quarkusio/quarkus-agent-mcp#296 ·
维护者通常 1 天内回复
-
enhancement web-ui
难度 2/5 1-3 小时 新手友好度 67/100
jenkinsci/jenkins#27583 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100
apache/rocketmq-dashboard#7302 ·
维护者通常 3 天内回复
-
area: android good first issue help wanted testing
难度 2/5 1-3 小时 新手友好度 75/100
Gautam-aman/ResQNet#56 ·
维护者通常 1 天内回复