WebSocket: a reset of either joined socket is logged at ERROR by ConnectionBase
Chưa có ai nhận issue này.
Đá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
- 62/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
- networking
Hướng nghiên cứu
Start in ReverseProxy.Proxy#sendResponse, where the client socket (request.proxiedRequest().toNetSocket()) and the backend socket (proxiedResponse.netSocket()) are joined with only handler and closeHandler. Read ConnectionBase#handleException to see why an unhandled reset is logged at ERROR. Done means both joined sockets get an exception handler that logs at trace and closes the other socket, with no reproducer test required.
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
Once the backend answers 101, ReverseProxy.Proxy#sendResponse joins the client socket
(request.proxiedRequest().toNetSocket()) and the backend socket (proxiedResponse.netSocket()) with handler and
closeHandler only. Neither socket gets an exception handler, so a failure on a joined socket is logged as an error.
The common case is a peer resetting its connection, which is routine for WebSockets (a closed tab, a mobile client
changing networks, a load balancer in front of the proxy closing its connection with a reset). With the native epoll
transport each one logs:
[ERROR] io.vertx.core.net.impl.ConnectionBase - recvAddress(..) failed with error(-104): Connection reset by peer
(Connection reset with the NIO transport.) Behind HAProxy this is a steady stream of ERROR lines, one per abruptly
ended WebSocket, that cannot be told apart from real failures.
Client side. toNetSocket() replaces the HTTP server connection with a new NetSocketImpl
(Http1ServerConnection#netSocket). The new connection does not keep the server's exception handler (which logs
connection failures at trace by default), so a reset takes this path:
- the read fails with
ECONNRESET, and Netty firesexceptionCaughtand then closes the channel; VertxHandler#exceptionCaughtcallsConnectionBase#handleExceptionon theNetSocketImpl;ConnectionBase#handleExceptionfinds no exception handler and logs the exception atERROR;- the channel closes,
closeHandlerfires and closes the backend socket.
Backend side. proxiedResponse.netSocket() is an HttpNetSocket over the request to the backend. A failure is
reported to that request's connection (Http1ClientConnection#handleException, which calls
ConnectionBase#handleException) and to the request (HttpClientRequestImpl#handleException), each of which logs it
at ERROR unless it has an exception handler, and then to the socket. The request and its connection belong to
whoever created the request (the OriginRequestProvider), so this issue only covers the joined sockets. Related: the
request also logs Connection was closed at ERROR whenever the proxy closes a WebSocket, a normal close included,
unless its creator sets an exception handler (the existing WebSocketTest tests log it on main).
The failure branch right below (Handle this case printed to System.err when toNetSocket() fails) is covered by
#155 / #156.
Steps to reproduce
- Proxy a WebSocket to a backend and let the backend answer
101. - Once data has gone through the proxy, reset the client connection (close it with
SO_LINGER0). - The proxy logs the reset at
ERRORfromio.vertx.core.net.impl.ConnectionBase.
Possible fix
Set an exception handler on both joined sockets, next to the closeHandlers, that logs at trace and closes the other
socket.
Do you have a reproducer?
The steps above; there is no test with the fix, because the change only affects what is logged. After an
IOException on a read, Netty closes the channel once it has reported the exception, and the existing closeHandlers
then close the other socket, so both sides close with or without the exception handlers. A test would have to capture
Vert.x's own log output, which nothing in this project does, and would depend on which logging backend the tests
happen to run with.
- 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
-
WebSocket: backend request left open when the client leaves before the upgrade completesCó thể đã có người làm @zenios đã nhận 10 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/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ự
-
ToolCallbackProvider AutoConfiguration does not preserve tool orderCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởstatus: waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
spring-projects/spring-ai#7206 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
eclipse-dirigible/dirigible#7958 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ci sev-6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
-
area/cli
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
quarkusio/quarkus#57623 · 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 72/100
jhipster/prettier-java#1113 ·
Maintainer thường phản hồi trong vòng 2 ngày