Mishandled request when 'Transfer-Encoding: chunked' is used on connection reuse.
Open
@cpretzer is already working on this.
Since Feb 13, 2020.
- Dominant language
- Scala
- Stars
- 5.3k
- Forks
- 494
- PR merge metrics
- No merged PRs in 30d
Description
Issue Type:
- Bug report
- Feature request
What happened:
When specifying Transfer-Encoding: chunked when an endpoint is dead and when trying to reuse a connection the second request never gets a response.
For example using curl to connect to a non existent endpoint twice.
curl --header "Transfer-Encoding: chunked" -x 127.0.0.1:4140 10.0.0.170:8000 10.0.0.170:8000
I get
Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000
as a response and curl hangs while waiting on a response to the second request.
But when I don't specify transfer encoding it works as expected
curl -x 127.0.0.1:4140 10.0.0.170:8000 10.0.0.170:8000
Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000
Unable to establish connection to 10.0.0.170:8000.
service name: /svc/10.0.0.170:8000
client name: /$/inet/10.0.0.170/8000
addresses: [10.0.0.170:8000]
selected address: 10.0.0.170:8000
There is nothing shown in any of the logs. I've confirmed this behaviour with 1.6.4 and 1.7.1. But it works correctly in 1.4.5 and 1.5.2.
Config is below
admin:
port: 9990
ip: 0.0.0.0
usage:
enabled: false
routers:
- protocol: http
label: incoming
dtab: |
/ip-hostport => /$/inet;
/ip => /$/io.buoyant.hostportPfx/ip-hostport;
/svc => /ip;
servers:
- port: 4140
ip: 0.0.0.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.