WebSocket: backend request left open when the client leaves before the upgrade completes
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Java
- Star
- 68
- Fork
- 38
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-vertx/vertx-http-proxy
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
-
Custom Hop-By-Hop HeadersCó thể làm lại được @Yash-294 đã nhận 374 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
eclipse-vertx/vertx-http-proxy#139 · 3 bình luận ·
Tất cả issue của eclipse-vertx/vertx-http-proxy
Issue tương tự
-
bug follow-up lane:backlog
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Sanne/incus-spawn#1576 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
checkstyle/checkstyle#22069 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
it-at-m/eNoVa-Editor#79 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày