cloudbase-ai opened a new pull request, #7896:
URL: https://github.com/apache/shenyu/pull/7896
Refs #5520.
An upstream transport timeout can still return `500
{"code":500,"message":"Internal Server Error"}` on current master. The HTTP
plugin only maps `java.util.concurrent.TimeoutException`; Reactor Netty's
connect/read/write timeouts and SocketTimeoutException, including
WebClientRequestException wrappers, otherwise reach GlobalErrorHandler without
an HTTP status.
Classify these timeout types after retry processing and return 504. Inspect
the cause chain with the existing cycle-safe Commons Lang utility, retain the
original exception as the cause, and use the recognized timeout's message or
`Upstream request timed out` when it has none. Already-assigned
ResponseStatusException statuses remain unchanged, including existing default
retry exhaustion 408 and failover 503. Connection refusal and unrelated errors
retain their existing behavior. Retry eligibility, counts, delays and budgets
are unchanged; in particular the existing backoff policies still do not retry
write timeouts.
Validation on Java 17 with the Maven wrapper:
- The initial regression suite had 29 failures out of 38 cases before the
fix, including actual local Netty and WebClient read timeouts. The final
41-case suite passes, covering direct/wrapped timeout types, no retry and
configured backoff, attempt counts, explicit and wrapped HTTP statuses,
ordinary connection refusal, generic wrapper messages and cyclic causes.
- `shenyu-web`, `shenyu-plugin-httpclient` and dependency reactor: **1,179
tests, 0 failures, 0 errors, 5 skipped**. Checkstyle, Apache RAT and `git diff
--check` pass.
- A separate local HTTP smoke harness runs a real client → HTTP plugin →
stalled upstream → actual GlobalErrorHandler → client. Against the unmodified
master HTTP plugin, both Netty and WebClient returned status 500 with the
generic JSON error. Against this change, both returned status 504 with
`{"code":504,"message":"Upstream request timed out"}`. Each made exactly one
upstream request with retries disabled. The upstream transport read timeout was
100 ms, below the plugin's 5 s deadline, so this exercises the missing
transport-error mapping rather than the already-handled Java deadline timeout.
```sh
./mvnw -B -ntp -pl shenyu-plugin/shenyu-plugin-httpclient,shenyu-web -am \
test apache-rat:check -DskipRemoteResources=true \
-Djacoco.skip=true -Dmaven.javadoc.skip=true
```
The wire smoke uses the real plugin and error handler with a directly
configured upstream URI; it is not a full Bootstrap/configuration-sync Docker
test. This change covers failures before the upstream response headers arrive.
It does not replace an HTTP status after the downstream response has already
been committed. #5520 remains referenced rather than automatically closed
because the historical report does not establish which timeout phase its
screenshots show.
- [x] Follow the contribution guidelines and DCO sign-off.
- [x] Add regression coverage and run the affected reactor checks above.
- [ ] Full-repository clean install (the affected web/httpclient reactor was
verified).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]