Skip to content

fix(mdx-web): bypass Spring suppression of client disconnect errors#349

Merged
stevecl5 merged 1 commit intomasterfrom
scl/revert-client-disconnect-error-handling
Feb 23, 2026
Merged

fix(mdx-web): bypass Spring suppression of client disconnect errors#349
stevecl5 merged 1 commit intomasterfrom
scl/revert-client-disconnect-error-handling

Conversation

@stevecl5
Copy link
Contributor

@stevecl5 stevecl5 commented Feb 21, 2026

Summary of Changes

After upgrading to Spring Boot 3.x (Spring Framework 6.2.x), we observed that path connectors were returning false-positive 200 OK responses with empty bodies when certain client disconnected exceptions were thrown (e.g. EOFException or IOException: Broken pipe).

This change was tracked down to a new feature in Spring 6.2's DefaultHandlerExceptionResolver. To suppress noisy logs, Spring now delegates to handleDisconnectedClientException(), which returns an empty ModelAndView object. Because a non-null ModelAndView is returned, the DispatcherServlet assumes the error was handled successfully, suppresses the exception, and instructs the servlet container to return a standard 200 response.

This MR fixes the regression by bypassing this suppression. It introduces a new WebMvcConfigurer that swaps out the default exception resolver with an implementation that returns null for disconnected clients. This restores the legacy (pre-6.2) behavior, forcing the DispatcherServlet to re-throw the exception so it can be properly handled and logged by our existing ErrorHandlerFilter / ErrorHandler chain.

Fixes GCU-1218

Public API Additions/Changes

N/A

Downstream Consumer Impact

Downstream consumers and services relying on the mdx-web project will no longer experience silent 200 OK responses when a network connection drops. The application will behave exactly as it did in Spring Boot 2.7.x, allowing disconnected client exceptions to bubble out of the Spring context and into our custom servlet filters.

There are no breaking changes to consumer APIs or interfaces, and no migration steps are required for downstream code.

How Has This Been Tested?

I pulled a snapshot version into path-connector-globalcu and modified the ProfileAccessor#get method to explicitly throw an exception that would be suppressed by Spring's new error handling.

In ProfileAccessor:

  @Override
  public AccessorResponse<Profile> get() {
    ConnectException connectException = new ConnectException("test", new EOFException("throwable test"));
    throw new ConnectException("test 2", connectException);
  }

Calling the get profile endpoint prior to my changes produced a false-positive 200 OK response:

GET http://localhost:3009/globalcu/users/U-00u3la36x0bbNvPud1d7/profile

HTTP/1.1 200 
Content-Length: 0
Date: Sat, 21 Feb 2026 22:29:27 GMT

<Response body is empty>

Response code: 200; Time: 23ms (23 ms); Content length: 0 bytes (0 B)

After my changes, it produced an expected error response:

GET http://localhost:3009/globalcu/users/U-00u3la36x0bbNvPud1d7/profile

HTTP/1.1 500 
Content-Type: application/vnd.mx.mdx.v6+json
Content-Length: 145
Date: Sat, 21 Feb 2026 22:16:46 GMT
Connection: close

{
  "error": {
    "message": "test 2",
    "user_message": "A system error has occurred. Please try again later or contact us at 800-525-9094 for assistance."
  }
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@stevecl5 stevecl5 force-pushed the scl/revert-client-disconnect-error-handling branch from 16e4e74 to 4dedf4b Compare February 23, 2026 23:05
@stevecl5 stevecl5 merged commit 29d4d29 into master Feb 23, 2026
7 checks passed
@stevecl5 stevecl5 deleted the scl/revert-client-disconnect-error-handling branch February 23, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants