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

Connection is dropped early with Content-Type "application/stream+json" #1197

Closed
sylvain-rouquette opened this issue Feb 7, 2019 · 2 comments
Labels
stale Issue is stale and will be closed

Comments

@sylvain-rouquette
Copy link

sylvain-rouquette commented Feb 7, 2019

Describe the bug
Connection is dropped early with Content-Type "application/stream+json", could be ambassador or AWS ELB.

To Reproduce
I have a K8S cluster deployed in AWS with kops, and ambassador is in front of my java backend. I also have an auth service in Go connected to ambassador.
Everything works fine with application/json requests.
I implemented an endpoint with Flux to support application/stream+json and text/event-stream. The endpoint works fine locally (without ambassador), but when I deploy it in my cluster and try a curl, I get this error.
"curl: (18) transfer closed with outstanding read data remaining"
I receive some data (2400 json objects over 10000)
When I check the logs, I notice that ambassador logs twice:

  • ambassador service receives the request
  • my java service receive the request
  • another ambassador service receives the request

The connection is closed when the second ambassador service receives the request.
Why does it receive that second request, could it be related?

Here is the response headers:

< HTTP/1.1 200 OK
< content-encoding: gzip
< expires: 0
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< x-xss-protection: 1; mode=block
< pragma: no-cache
< x-frame-options: DENY
< date: Thu, 07 Feb 2019 15:38:31 GMT
< x-content-type-options: nosniff
< content-type: application/stream+json
< x-envoy-upstream-service-time: 11
* Server envoy is not blacklisted
< server: envoy
< transfer-encoding: chunked

Expected behavior
The connection shouldn't be closed before I receive all the data.

Versions (please complete the following information):

  • Ambassador: 0.50.0, but didn't work on 0.40.2 as well.
  • Kubernetes environment AWS
  • Version 1.10.11

Additional context
I need help, but it seems I can't but the tag on this issue.

@sylvain-rouquette
Copy link
Author

I was able to fix my problem by setting a timeout in my mapping. The hint was in ambassador's log, 'x-envoy-expected-rq-timeout-ms', '3000'.

Is this the expected behavior to have the request closed by ambassador, while there's still some data being downloaded?

My request doesn't have a Content-Length since it's a stream, it could be related.

Feel free to close my bug if you consider it isn't one.

@stale
Copy link

stale bot commented Jun 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue is stale and will be closed label Jun 5, 2019
@stale stale bot closed this as completed Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is stale and will be closed
Projects
None yet
Development

No branches or pull requests

1 participant