-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
gRPC streaming responses smaller than 4KB are buffered indefinitely #3188
Comments
You can reproduce the issue easily with https://github.com/ericbottard/knative-grpc, by following the steps described in the README file. |
From here: // FlushInterval specifies the flush interval
// to flush to the client while copying the
// response body.
// If zero, no periodic flushing is done.
FlushInterval time.Duration I wonder if this would at least help mitigate the problem? |
Though setting the payload to 10 bytes, I see the test hang at this for a while (and now it is on to the scale to zero)
Though, I only tried it in |
This issue mentions exactly the issue we are seeing fabiolb/fabio#324 |
cc @bradfitz in case he has any recommendations that aren't forking this library. |
In Go 1.12, an explicit negative interval disables buffering, but it's also disabled for https://tip.golang.org/pkg/net/http/httputil/#ReverseProxy.FlushInterval
Have you tried Go 1.12? Go 1.12rc1 is out. |
That's actually perfect, we switched to 1.12 for websocket support yesterday :) |
Thanks @bradfitz, I'll try that out when I get back |
Hmm, this doesn't seem to do it. |
@tcnghia and I got it. |
In Go 1.12 setting `FlushInterval` to -1 makes it `Flush()` the ResponseWriter on each `Write()` (thanks @bradfitz). We also need the `ResponseWriter` wrappers we have to implement `http.Flusher` for this to work. Fixes: knative#3188
In what area(s)?
/area networking
What version of Knative?
HEAD
Expected Behavior
Streaming gRPC responses should be returned immediately.
Actual Behavior
Streaming gRPC responses are held until a 4KB buffer is filled.
Steps to Reproduce the Problem
Reported by @fbiville:
The text was updated successfully, but these errors were encountered: