zbchi opened a new pull request, #3281:
URL: https://github.com/apache/dubbo-go/pull/3281
### Description
#### Before
#3266
If HTTP/3 failed, the client could then fall back to HTTP/2 with the same
`http.Request`.
That behavior is risky for Triple, because request bodies come from
`io.Pipe` or other non-replayable streams.
It also means a broken HTTP/3 path can keep being retried instead of letting
the client stay on the healthy HTTP/2 path.
#### After
The client now keeps HTTP/2 as the stable path, learns about HTTP/3 from
`Alt-Svc` on HTTP/2 responses, and validates the HTTP/3 path with an
independent probe before switching later requests. Once HTTP/3 is known to be
healthy, future requests may use it. If HTTP/3 later fails, the client does not
replay the current request on HTTP/2; instead, it marks the HTTP/3 path
unhealthy, enters cooldown, and keeps subsequent requests on HTTP/2 until it is
time to probe again.
This is also closer to the approach used in `dubbo`: treat HTTP/3 as an
upgrade that must be validated out of band, rather than retrying the current
business request across transports.
in short, the behavior now is :
1. HTTP/2 remains the default and stable path.
2. `Alt-Svc` on HTTP/2 responses makes the origin a candidate for HTTP/3.
3. An independent HTTP/3 probe (`OPTIONS /`) is used to validate the path.
4. Only future requests switch to HTTP/3 after the probe succeeds.
5. If an HTTP/3 business request fails, the current request is not
replayed on HTTP/2.
6. Failed HTTP/3 paths enter cooldown so the client does not keep retrying
them immediately.
7. Caller-driven context cancellation/deadline errors do not mark the
HTTP/3 path as unhealthy.
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature
works
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]