Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

WebSocket: backend request left open when the client leaves before the upgrade completes

已关闭
#155 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@tsegismont 已经在做这个了。

开始于 2026年10月20日。

  • #156 来自 @zenios —— 已合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java

调研方向

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:

  1. 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).
  2. Backend answers 101 after the client left: proxiedRequest().toNetSocket() fails, the failure branch prints
    Handle this case and a stack trace to System.err, and the backend socket is never closed.
  3. Client already gone when the origin is resolved (e.g. an OriginRequestProvider doing 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
  1. Proxy to a backend that reads the upgrade request and never answers.
  2. Send a WebSocket upgrade through the proxy, then close the client connection.
  3. 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-vertx/vertx-http-proxy 的其他 Issue

查看 eclipse-vertx/vertx-http-proxy 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。