8000 Stream chunked responses from Consul API · Issue #2288 · linkerd/linkerd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Stream chunked responses from Consul API #2288

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 a 8000 gree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dadjeibaah opened this issue Jun 24, 2019 · 0 comments · Fixed by #2295
Closed

Stream chunked responses from Consul API #2288

dadjeibaah opened this issue Jun 24, 2019 · 0 comments · Fixed by #2295

Comments

@dadjeibaah
Copy link
Contributor

Consul's Agent API automatically switches to chunked responses when service discovery information becomes significantly large. Based on #2286, the HTTP client in the Consul namer does not handle chunked responses properly because the JSON parser expects the JSON data to be the entire payload when it begins parsing. The namer should be able to handle this scenario.

adleong pushed a commit that referenced this issue Jul 17, 2019
This work is continuation of #2287. In essence the change enables `streaming` for the consul http client and as a result of that makes handling large consul responses easier (i.e. not limited by max size config). The PR exposes the `fixedLengthStreamedAfterKB` which as described in the docs

> configures `fixedLengthStreamedAfter` limit, which effectively turns on streaming (think `withStreaming(true)`). The `fixedLengthStreamedAfter`, however, disables streaming for sufficiently small messages of known fixed length.

In order to reproduce the initial issue and validate the solution you can use the method described by @dadjeibaah in #2287. Note that if you want to see the initial issue you need to first run against [this](753fc17) version of the code.  After this PR is applied you can run the example again and convince yourself that exception is not thrown despite the fact that the message size configuration is not tweaked.

Fixes #2288 

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
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 a pull request may close this issue.

1 participant
0