Open Bug 1361348 Opened 7 years ago Updated 2 years ago

Duplicated requests when network errors happen multiple time

Categories

(Core :: Networking: HTTP, defect, P3)

53 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: xias1, Unassigned)

References

Details

(Whiteboard: [necko-backlog])

Attachments

(2 files, 3 obsolete files)

Attached file index.html (obsolete) —
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce:

Open the attached HTML page from a http server. The page only has 10 script tags that points to 10 different scripts which all have network error (404).

Let's say those script tags are 0.js, 1.js, 2.js, ..., 9.js, which all gives 404.


Actual results:

Should see 10 network errors in the dev tool, but it randomly and almost every time shows more than 10 network errors (mostly 19 errors):

> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9

Which really should be:

> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Reduce it to 5 scripts from 0.js to 4.js

> 0, 1, 2, 3, 4, 1, 2, 3, 4

Reduce it to 2 scripts 0.js and 1.js

> 0, 1, 1

Once it is reduced to 1 script with network error, it no longer have duplicated requests.

> 0

---

Adding `onerror="this.parentNode.removeChild(this)"` does not prevent the duplicated requests from happening. Put a console.log into onerror hook shows that the duplicated request happens after the onerror hook.


Expected results:

It should not attempt to request the script once it fails.

I also tried Safari and Chrome. They both have a similar behavior, expect that the duplicated requests in Safari and Chrome happens more randomly.

I'm not sure if this is any kind of intended behavior since all the major browsers have the similar problem. However, even if this is intended behavior (e.g. maybe to deal with bad network condition?), a given error handler should prevent duplicated requests.
Attached file 10scripts.html (obsolete) —
Attached image screenshot of network panel in dev tool (obsolete) —
Attachment #8863715 - Attachment is obsolete: true
Attached file index.html
Attachment #8863717 - Attachment is obsolete: true
Attachment #8863718 - Attachment is obsolete: true
A similar chromium problem: https://bugs.chromium.org/p/chromium/issues/detail?id=717507
Component: Untriaged → Networking: HTTP
Product: Firefox → Core
Something preload/prefetch related?
Whiteboard: [necko-backlog]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: P1 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: