-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DownstreamStatus is 0 in v3 when server-sent event response is aborted from client #10807
Comments
Hello @dj-shin, Thanks for reporting this! Could you please also share a minimal dynamic configuration to reproduce the issue? |
Hello @rtribotte, thank you for the fast check! Here's our dynamic config: http:
serversTransports:
reuseConnection:
maxIdleConnsPerHost: 5
forwardingTimeouts:
idleConnTimeout: 600s
middlewares:
CORS-Header:
headers:
accessControlAllowMethods:
- GET
- OPTIONS
- PUT
- POST
accessControlAllowHeaders:
- Authorization
- Content-Type
accessControlAllowOriginListRegex:
- ...
accessControlAllowCredentials: true
accessControlMaxAge: 100
addVaryHeader: true
routers:
router-test:
entryPoints:
- inference-server
middlewares:
- CORS-Header
- auths
service: test-cluster
rule: PathPrefix(`/test`)
router-inference:
entryPoints:
- inference-server
middlewares:
- CORS-Header
- auths
service: inference-cluster
rule: PathPrefix(`/`)
services:
inference-cluster:
loadBalancer:
healthCheck:
path: /ping
interval: 15s
timeout: 10s
servers:
- url: ...
serversTransport: reuseConnection
test-cluster:
loadBalancer:
servers:
- url: ...
serversTransport: reuseConnection |
Hey @dj-shin , Thanks for the additional information. |
I’d love to help here, but I guess a minimal repro with a server/client setup similar to OP’s would go a long way. @dj-shin if possible, could you provide a minimal dockerised reproduction of your setup? |
Thank you for your attention, @hood ! I've also tested in this setup too that v2.11 logs different output |
@nmengin Just reproduced this in my environment. Looks like moving the deferred closing function declaration right before the // `capt` initialised above...
defer func(capt capture.Capture) {
if h.config.BufferingSize > 0 {
h.logHandlerChan <- handlerParams{
logDataTable: logDataTable,
}
return
}
logDataTable.DownstreamResponse.status = capt.StatusCode()
logDataTable.DownstreamResponse.size = capt.ResponseSize()
logDataTable.Request.size = capt.RequestSize()
h.logTheRoundTrip(logDataTable) // <- this now logs updated request data.
}(capt) // <- with `capt` initialised above, we can now pass it to our deferred fn.
next.ServeHTTP(rw, reqWithDataTable) I’m not familiar with the codebase, so while I've run the tests and made sure nothing breaks (integration tests are not passing locally, but I guess it’s some misconfiguration on my side), @dj-shin Could you please try this branch and confirm that it solves the issue you reported? |
Thank you for your work, @hood ! |
Welcome!
What did you do?
In Traefik v2.11, when client aborts server-sent events response stream,
DownstreamStatus
was200
in the access log.After upgrading to v3.0 the response itself is working as same as before, but in the access log
DownstreamStatus
is now logged as0
.Reproducible docker compose setup
What did you see instead?
v2.11 access log:
v3.0.2 access log:
What version of Traefik are you using?
Tested in v3.0.1 & v3.0.2 and both behaviors where same.
v2.11 works fine.
What is your environment & configuration?
Add more configuration information here.
If applicable, please paste the log output in DEBUG level
No response
The text was updated successfully, but these errors were encountered: