Add warn logging when WebSocket message receive fails#4134
Open
fru1tworld wants to merge 1 commit intospring-cloud:mainfrom
Open
Add warn logging when WebSocket message receive fails#4134fru1tworld wants to merge 1 commit intospring-cloud:mainfrom
fru1tworld wants to merge 1 commit intospring-cloud:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds WARN-level logging to surface otherwise-silent WebSocket receive failures in the gateway’s WebSocket proxying path, improving diagnosability of disconnects such as oversized frames (gh-1048).
Changes:
- Added
doOnErrorhooks on the client→backend and backend→clientreceive()streams inWebsocketRoutingFilter. - Logs WARN with both session IDs and the exception when a receive error occurs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...r-webflux/src/main/java/org/springframework/cloud/gateway/filter/WebsocketRoutingFilter.java
Outdated
Show resolved
Hide resolved
...r-webflux/src/main/java/org/springframework/cloud/gateway/filter/WebsocketRoutingFilter.java
Outdated
Show resolved
Hide resolved
...r-webflux/src/main/java/org/springframework/cloud/gateway/filter/WebsocketRoutingFilter.java
Show resolved
Hide resolved
When gateway proxies WebSocket connections and a message exceeds the max frame payload length, the connection is dropped silently. Add doOnError handlers to log a warning with session details, making it easier to diagnose frame size issues. Fixes spring-cloudgh-1048 Signed-off-by: fru1tworld <fruitworld.planet@gmail.com>
27df98f to
b6feead
Compare
Contributor
Author
|
Fixed — removed the frame-size hint and left the cause to the throwable itself |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the gateway proxies WebSocket connections and a message exceeds the max frame payload length, the connection is dropped silently with no logging even at TRACE level. This makes it difficult to diagnose WebSocket connectivity issues.
Changes
doOnErrorhandlers to both client-to-backend and backend-to-client WebSocket message flows inWebsocketRoutingFilterFixes gh-1048