Closed Bug 977398 Opened 11 years ago Closed 5 years ago

Necko cache behaviour messes with media server byte range support detection code, causes media mochitest failures

Categories

(Core :: Audio/Video: Playback, defect, P2)

x86_64
Windows 8.1
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: cpearce, Assigned: cpearce)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

I added an XHR to test_buffered.html, but that has a nasty and unforeseen side effect; the necko cache will cache the request's response, and return it when ChannelMediaResource requests the same resource later. It returns the cached response code (200) too, meaning that we assume that the stream is unseekable. This causes an intermittent timeout in test_bug495300.html on seek.ogv. Once we decide the channel is unseekable there's a data race between the channel/necko filling the media cache and the test running. Once the test starts, the test seeks the <video> to its end/duration. If the MediaCache entry for that video hasn't filled yet, the ogg file will try to seek to the duration, but since the transport is considered unseekable we'll trim the seek target to be within the HTMLMediaElement.seekable ranges. So since the resource isn't fully buffered, we'll trim the seek target, and end up seeking half way through the resource. The test is waiting on an ended event, and since we're not playing we won't ever reach the end, so the test times out. I filed a bug 977314 in necko to see if we can get the cache/necko/something to handle this whole situation better. In the meantime, we should always do a 0- byte range request in all XHR in the media mochitests, so that the necko cache doesn't trip us up!
Attached patch Patch (obsolete) (deleted) — Splinter Review
Do 0- Byte Range Requests in all XHR in media mochitests, so the necko cache behaviour doesn't mess with us. This is a "temporary" measure until a proper necko fix can occur.
Attachment #8382661 - Flags: review?(kinetik)
I think it'd be better to serve the files we care about not being cached with "Cache-Control: no-store". We should be able to do that via the special ^foo^ files.
Set Cache-Control: no-store for all the files we care about.
Attachment #8382661 - Attachment is obsolete: true
Attachment #8382661 - Flags: review?(kinetik)
Attachment #8382704 - Flags: review?(kinetik)
Comment on attachment 8382704 [details] [diff] [review] Patch v2: set cache-control: no-store Add the rest of the ^headers^ files to mochitest.ini. :-)
Attachment #8382704 - Flags: review?(kinetik) → review+
Summary: XHR in media mochitests should do 0- byte range requests for the time being... → Necko cache behaviour messes with media server byte range support detection code, causes media mochitest failures
Chris, Cache-control: no-store means to just keep the entries in memory. Did you want to use no-cache to make Necko check with the server (i.e. do the request again) every time?
Hm.. no-store will make the response non-resumable. So it is probably what you want.
Component: Audio/Video → Audio/Video: Playback
Rank: 15
Priority: -- → P2

Not sure why this bug was never closed. We still use "Cache-Control: no-store" when serving all media for mochitests, so resolving this.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: