Skip to content
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

Streaming a backend response-body seems to be broken with proxy. #766

Closed
malud opened this issue Aug 25, 2023 · 0 comments · Fixed by #787
Closed

Streaming a backend response-body seems to be broken with proxy. #766

malud opened this issue Aug 25, 2023 · 0 comments · Fixed by #787
Assignees
Labels
bug Something isn't working regression An already working behaviour is broken

Comments

@malud
Copy link
Collaborator

malud commented Aug 25, 2023

Describe the bug

While Couper tries to detect the usage of body or json_body variable references to decide to read the upstream response body or not the condition for that seems to be broken since Couper will buffer the content even those variables are not in use.

To Reproduce
Steps to reproduce the behavior:

  1. Which Couper version? Run couper version or docker run avenga/couper version

edge and 1.12

  1. Provide your configuration file *.hcl. Remove sensitive data.
server {
  endpoint "/" {
    proxy {
      url = "http://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.3-live-server-arm64.iso"
    }
  }
}
  1. Provide a curl call for reproduction

curl -v http://localhost:8080/

Expecting to see data chunks while streaming the iso file but it all gets loaded into memory if you closely watch the Couper process allocs.

@malud malud added bug Something isn't working regression An already working behaviour is broken labels Aug 25, 2023
@malud malud self-assigned this Aug 25, 2023
malud added a commit that referenced this issue Aug 28, 2023
malud added a commit that referenced this issue Nov 22, 2023
@malud malud linked a pull request Nov 22, 2023 that will close this issue
malud added a commit that referenced this issue Nov 22, 2023
malud added a commit that referenced this issue Nov 28, 2023
malud added a commit that referenced this issue Dec 1, 2023
malud added a commit that referenced this issue Dec 1, 2023
malud added a commit that referenced this issue Dec 1, 2023
malud added a commit that referenced this issue Dec 1, 2023
malud added a commit that referenced this issue Dec 1, 2023
* Fix buffer option related condition which prevents the proxy block to stream a backend response #766

* Fix malformed mime header in test case (byte code)

* Fix buffer condition and related body parse in combination with syncedVariables provided by each backend instance

* fix test expectation url

* Fix random order related to the default block while preparing roundtrips

* fix test expectation

* Refactor buffer option pkg; include buffer option to json sync calls

* increase timeout

* increase produce delay; add hint for local var in test

* inc time before calling metrics endpoint in metrics test

* add changelog #766

* fix metrics test; just one call to metrics ep

* (ci) skip metrics test

* Fix wrong seq reference; TODO: validation check!
@malud malud closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression An already working behaviour is broken
Projects
None yet
1 participant