Skip to content

Trafficserver holds chunked response for backend down case #7880

@lukenowak

Description

@lukenowak

We have a situation where the backend returns a response with body size > 2048 bytes without Content-Lenght. This leads to TrafficServer returning it further with Transfer-Encoding: chunked. If the body size is <= 2048 TrafficServer adds Content-Length by itself and serves the content happily.

We are using TrafficServer 8.1.1, but the same behaviour is with 9.0.1.

Our configuration:

  • proxy.config.http.negative_revalidating_enabled 1
  • proxy.config.http.cache.max_stale_age 604800
  • proxy.config.http.negative_revalidating_lifetime 0
  • proxy.config.http.chunking_enabled 1 (default)
  • proxy.config.http.chunking.size 4096 (default)
  • proxy.config.http.server_ports 10.0.117.32:23432
  • proxy.config.http.keep_alive_no_activity_timeout_in 10 (this is for the test environment, but higher values in live environment just extend the case)

If the backend is up (returns 200) and negative_revalidating_enabled does not kick in, TrafficServer returns the full response (headers and body) immediately.

The backend up case communication between client and TrafficServer:

backend-up-case

So we happily support the case when the backend is down, but after returning headers it is giving part of the body as chunked, but does not finish it with \r\n0\r\n, which leads to the client being “stuck” for the time of proxy.config.http.keep_alive_no_activity_timeout_in, when then the TrafficServer sends FIN/ACK to the client, somehow releasing it. Seems that RFC is not followed.

The backend down case communication between client and TrafficServer:

backend-down-case

Setting proxy.config.http.chunking_enabled to 0 fixes the issue, but we can't accept it as a workaround, as we rely on chunked encoding for many cases, especially for backend-up ones.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions