You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/10/01 19:36:13 UTC

[GitHub] [trafficserver] elsloo commented on issue #7230: Presence of Transfer-Encoding and Content-Length headers leads to empty response

elsloo commented on issue #7230:
URL: https://github.com/apache/trafficserver/issues/7230#issuecomment-702353737


   Update: after further troubleshooting and testing, we now understand the cause of this issue.
   
   1. Client facing ATS instance receives a request for an object that results in a cache miss
   2. ATS proxies the request to another ATS instance, which is also is a cache miss
   3. ATS proxies the request to the origin, receives a 200 OK and the object, fills its cache and returns the object
   4. Client facing ATS receives this object and returns it to the client
   
   `n` seconds later per `Cache-Control: max-age`, the object is revalidated by the ATS cache in front of the origin following a similar sequence:
   
   1. Client facing ATS instance receives a request for an object that results in a cache miss
   2. ATS proxies the request to another ATS instance that has the object in cache but it must be revalidated
   3. ATS sends an IMS request to the origin, receives and a 304 Not Modified, however:
       - The origin also appends a `Transfer-Encoding: chunked` header that is merged into the cached headers
       - The origin doesn't send an accompanying `0\r\n` chunk with the response
   4. Client facing ATS receives the object from the upstream ATS cache with both a `Content-Length` and `Transfer-Encoding` header and the full body, but the chunk handling fails and lands in the block linked above and aborts the client's request
   
   The origin's response appears to violate the intended use of `Transfer-Encoding: chunked` but the ATS cache that receives that response as a result of an IMS doesn't notice and caches the additional header. When that object is attempted to be served from that cache any time in the future, both headers are served, and the downstream ATS hosts are thrown off by the `Transfer-Encoding: chunked` header and lack of chunked response. For what it's worth, curl similarly gets confused by the presence of both headers.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org