[ 
https://issues.apache.org/jira/browse/TS-1955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810712#comment-13810712
 ] 

Leif Hedstrom commented on TS-1955:
-----------------------------------

Ok, I've tested this with v4.1.0 ("RC candidate"), and it's definitely very 
broken. Here's what's wrong:

1) It will try to serve it out of the partially written cache. This means that 
it'll hang until the part that it needs is actually written to cache. This on 
it's own is both good and bad, but probably should be configurable.

2) What's particularly bad is that it returns the completely wrong 
Content-Length: header :-/. E.g.
{code}
Content-Range: bytes 1073741824-1073741834/1073741835
Content-Length: 1073741835
Age: 5
Connection: keep-alive

Last Bytes
{code}

Note how it got the Content-Range: right, and it returns the right body ("Last 
Bytes" is the last 11 bytes. But, I expect the response to have a 
{code}
Content-Length: 11
{code}

Broken!

3) As a side effect of 2) , some clients will now hang on this. This is because 
it's telling us that we should see a very large object  (per the 
Content-Length: header), but it's only sending 11 bytes (as it should). Fixing 
#2 will fix #3, I'm sure.

So, I think at a minimum, we need to fix 2) above. Ideally, we also make an 
addition such that the owner of the ATS box can specify if request that can't 
(currently) be filled out of a read_while_write cache goes straight to origin. 
But I can see a use case for both behavior, honestly.


> read_while_writer sends wrong response for range request.
> ---------------------------------------------------------
>
>                 Key: TS-1955
>                 URL: https://issues.apache.org/jira/browse/TS-1955
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.2.4
>            Reporter: jaekyung oh
>            Assignee: Alan M. Carroll
>              Labels: range
>             Fix For: 4.2.0
>
>
> Basically read_while_writer works fine when ATS handles normal file.
> In progressive download and playback of mp4 in which moov atom is placed at 
> the end of the file, ATS makes and returns wrong response for range request 
> from unfulfilled cache when read_while_writer is 1.
> In origin, apache has h264 streaming module. Everything is ok whether the 
> moov atom is placed at the beginning of the file or not in origin except a 
> range request happens with read_while_writer.
> Mostly our customer’s contents placed moov atom at the end of the file and in 
> the case movie player stops playing when it seek somewhere in the movie.
> to check if read_while_writer works fine,
> 1. prepare a mp4 file whose moov atom is placed at the end of the file.
> 2. curl --range xxxx-xxxx http://www.test.com/mp4/test.mp4 1> 
> no_cache_from_origin 
> 3. wget http://www.test.com/mp4/test.mp4
> 4. right after wget, execute “curl --range xxxx-xxxx 
> http://www.test.com/mp4/test.mp4 1> from_read_while_writer” on other terminal
> (the point is sending range request while ATS is still downloading)
> 5. after wget gets done, curl --range xxxx-xxxx 
> http://www.test.com/mp4/test.mp4 1> from_cache
> 6. you can check compare those files by bindiff.
> The response from origin(no_cache_from_origin) for the range request is 
> exactly same to from_cache resulted from #5's range request. but 
> from_read_while_writer from #4 is totally different from others.
> i think a range request should be forwarded to origin server if it can’t find 
> the content with the offset in cache even if the read_while_writer is on, 
> instead ATS makes(from where?) and sends wrong response. (In squid.log it 
> indicates TCP_HIT)
> That’s why a movie player stops when it seeks right after the movie starts.
> Well. we turned off read_while_writer and movie play is ok but the problems 
> is read_while_writer is global options. we can’t set it differently for each 
> remap entry by conf_remap.
> So the downloading of Big file(not mp4 file) gives overhead to origin server 
> because read_while_writer is off.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to