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

Proxying with puma seems to be unreliable even with non-chunked encoding #7

Open
pedrocr opened this issue Apr 18, 2014 · 1 comment

Comments

@pedrocr
Copy link

pedrocr commented Apr 18, 2014

While creating a testcase for bug #6 I ended up finding an unreliable result with proxying non-chunked content. Here's the testcase:

https://github.com/pedrocr/camerasink/blob/b01aac64e8aaef96f8527f6e29768cc1f5f6199b/testcases/puma_unreliable_proxying.ru

Again this is runnable as "rackup puma_unreliable_proxying.ru".

Then asking for the same resource multiple times from the original server works fine:

$ curl http://localhost:9000
Hello!
pedrocr@wintermute:~$ curl http://localhost:9000
Hello!
pedrocr@wintermute:~$ curl http://localhost:9000
Hello!
pedrocr@wintermute:~$ curl http://localhost:9000
Hello!
pedrocr@wintermute:~$ curl http://localhost:9000
Hello!

But doing the same from the proxy server sometimes returns an empty result:

pedrocr@wintermute:~$ curl http://localhost:9292
Hello!
pedrocr@wintermute:~$ curl http://localhost:9292
pedrocr@wintermute:~$ curl http://localhost:9292
Hello!
@whitehat101
Copy link

I was just curious, so I wrote a test for your test.

# puma_unreliable_proxying_test.rb
cnt = 0
1000.times do
  str = `curl http://localhost:9292 --silent`
  cnt += 1 if str == "Hello!\n"
end

puts cnt

When I commented the puma require and WEBrick was used, 1000/1000 requests were proxied each time.

When using puma, between 970 and 980 requests would be proxied, and the remainder returned an empty string.

I did two 10k runs. They proxied 9741 and 9734 requests.

puma version 2.11.3
rack-streaming-proxy 2.0.1

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

No branches or pull requests

2 participants