Skip to content

Do not overwrite async timeout 503 with sendError(500) in afterProcess#1778

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:fix/async-request-not-usable-overwrite
May 4, 2026
Merged

Do not overwrite async timeout 503 with sendError(500) in afterProcess#1778
Croway merged 1 commit into
apache:mainfrom
Croway:fix/async-request-not-usable-overwrite

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 4, 2026

Summary

  • When Spring's async timeout handler sends 503, the Camel executor thread's afterProcess() catches AsyncRequestNotUsableException from writeResponse() and falls through to sendError(500), overwriting the 503
  • Detect AsyncRequestNotUsableException in afterProcess() and service() and skip the sendError(500) fallback
  • Uses class name check to avoid hard compile-time dependency on spring-web

Test plan

  • New SpringBootPlatformHttpAsyncNotUsableTest with two test methods:
    • testAsyncNotUsableShouldNotOverwriteWith500 — verifies no 500 when AsyncRequestNotUsableException is thrown
    • testRegularIOExceptionStillReturns500 — verifies regular IOException still produces 500
  • Test fails before fix (gets 500), passes after fix
  • All 99 platform-http tests pass (0 failures, 0 errors) when combined with Fix circular dependency and test failures with Spring Boot 4.0.6 #1777

When Spring's async timeout handler sends 503, the executor thread's
afterProcess() catches AsyncRequestNotUsableException from writeResponse()
and falls through to sendError(500), overwriting the 503. Skip the
sendError(500) fallback when the failure is AsyncRequestNotUsableException.
@Croway Croway force-pushed the fix/async-request-not-usable-overwrite branch from 44d5241 to 8ff8351 Compare May 4, 2026 17:19
@Croway
Copy link
Copy Markdown
Contributor Author

Croway commented May 4, 2026

The failures are expected, #1777 this PR fixes those failing tests.

@Croway Croway merged commit 4901b33 into apache:main May 4, 2026
2 of 5 checks passed
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.

1 participant