Skip to content

Fix client disconnect logged as error in WebFlux#36822

Open
suuuuuuminnnnnn wants to merge 1 commit into
spring-projects:mainfrom
suuuuuuminnnnnn:fix/gh-36811-client-abort-logging
Open

Fix client disconnect logged as error in WebFlux#36822
suuuuuuminnnnnn wants to merge 1 commit into
spring-projects:mainfrom
suuuuuuminnnnnn:fix/gh-36811-client-abort-logging

Conversation

@suuuuuuminnnnnn
Copy link
Copy Markdown

In HttpWebHandlerAdapter.handleUnresolvedError(), when a client
disconnects before the response is committed (e.g., the client
sends a partial request body and closes the connection), the
resulting AbortedException arrives while setStatusCode(500)
still returns true. This causes the handler to immediately log
a 500 Server Error at ERROR level and return, making the
checkAndLogClientDisconnectedException branch unreachable.

This commit moves the disconnect check before the 500 status
assignment. DisconnectedClientHelper.isClientDisconnectedException
already excludes outbound/remote-call exception wrappers, so the
reordering does not affect server-side error handling.

Closes gh-36811

In HttpWebHandlerAdapter.handleUnresolvedError(), when a client
disconnects before the response is committed, setStatusCode(500)
succeeds and logs a 500 Server Error at ERROR level. The
checkAndLogClientDisconnectedException check was never reached.

Move the disconnect check before the 500 status assignment.
DisconnectedClientHelper already excludes remote-call wrappers
so the reordering does not affect server-side error handling.

Closes spring-projectsgh-36811

Signed-off-by: suuuuuuminnnnnn <sumin45402214@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client-caused AbortedException gets logged as error

2 participants