Opened 10 years ago

Closed 10 years ago

#543 closed defect (invalid)

keepalive is lost if connection is HTTP/1.0 and request is proxied and chunked

Reported by: Markus Linnala Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.5.x
Keywords: Cc:
uname -a: Linux tester 3.13.9-200.fc20.x86_64 #1 SMP Fri Apr 4 12:13:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.5.13
built by gcc 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)
configure arguments: --with-http_sub_module

Description

I've testsuite to test if connection is kept alive over some proxied connections.

Connections are closed request is HTTP/1.0+keepalive and if proxy response is chunked.

At least apache bench (ab) uses HTTP/1.0+keepalive connections and now nginx does not get best results when connections are closed too early.

I have tried several versions, but none seems to work.

http_keepalive_proxy.t .. 1/16
#   Failed test 'ka-ch-ka/1.0'
#   at http_keepalive_proxy.t line 120.
#                   'HTTP/1.1 200 OK
# Server: nginx/1.5.13
# Date: Thu, 17 Apr 2014 14:02:55 GMT
# Connection: close
# X-Request: 9
# X-Connection: 10
#
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
#     doesn't match '(?^:Connection: keep-alive)'
http_keepalive_proxy.t .. 10/16 
#   Failed test 'cl-ch-ka/1.0'
#   at http_keepalive_proxy.t line 126.
#                   'HTTP/1.1 200 OK
# Server: nginx/1.5.13
# Date: Thu, 17 Apr 2014 14:02:56 GMT
# Connection: close
# X-Request: 13
# X-Connection: 14
#
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
#     doesn't match '(?^:Connection: keep-alive)'
# Looks like you failed 2 tests of 16.
http_keepalive_proxy.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/16 subtests 

Test Summary Report
-------------------
http_keepalive_proxy.t (Wstat: 512 Tests: 16 Failed: 2)
  Failed tests:  9, 13
  Non-zero exit status: 2
Files=1, Tests=16,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.07 cusr  0.02 csys =  0.12 CPU)
Result: FAIL

Attachments (3)

http_keepalive_proxy.t (5.3 KB ) - added by Markus Linnala 10 years ago.
http_keepalive_proxy-2.t (3.7 KB ) - added by Markus Linnala 10 years ago.
http_keepalive_proxy-2.2.t (3.9 KB ) - added by Markus Linnala 10 years ago.

Download all attachments as: .zip

Change History (4)

by Markus Linnala, 10 years ago

Attachment: http_keepalive_proxy.t added

comment:1 by Valentin V. Bartenev, 10 years ago

Resolution: invalid
Status: newclosed

You have sub_filter enabled. As a result nginx cannot know the content-length of a response, so the only one way left to indicate end of the response body is closing connection.

by Markus Linnala, 10 years ago

Attachment: http_keepalive_proxy-2.t added

by Markus Linnala, 10 years ago

Attachment: http_keepalive_proxy-2.2.t added
Note: See TracTickets for help on using tickets.