Open Bug 1251121 Opened 9 years ago Updated 3 years ago

EventSource (Server Sent Event) doesn't retry if the server is down during the first attempt to connect

Categories

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

46 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: duanyao.ustc, Unassigned)

References

Details

(Whiteboard: btpp-followup-2016-03-10 [necko-triaged])

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0 Build ID: 20160210153822 Steps to reproduce: Open the console in arbitrary web page, and run the following code: var es = new EventSource('http://localhost:7777'); Assume you don't have a web server on port 7777 on your computer. The console shows: Firefox can't establish a connection to the server at http://localhost:7777/. And check the value of `es.readyState`. Actual results: `es.readyState` is CLOSED (2), and Firefox won't retry. Expected results: `es.readyState` should be CONNECTING(0), and Firefox should repeat retrying. Chrome 48 does repeat retrying in this case. The spec says: https://html.spec.whatwg.org/multipage/comms.html#processing-model-9 >Network errors that prevents the connection from being established in the first place (e.g. DNS errors), should cause the user agent to reestablish the connection in parallel, unless the user agent knows that to be futile, in which case the user agent may fail the connection. I think "server down" situation is not always permanent, so browser should retry.
Flags: needinfo?(bugs)
Whiteboard: btpp-followup-2016-03-03
Whiteboard: btpp-followup-2016-03-03 → btpp-followup-2016-03-10
This bug is marked needinfo but there's no indication of what info is needed; is there some info I could gather? I am also having this problem, and I agree with duanyao about the reading and interpretation of the standard (and also, a temporary ECONNREFUSED, ENETUNREACH, or ETIMEDOUT seem like exactly the situations in which automatic reconnection is desirable).
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
Component: DOM: Core & HTML → DOM: Networking
Flags: needinfo?(bugs)
Whiteboard: btpp-followup-2016-03-10 → btpp-followup-2016-03-10 [necko-triaged]
See Also: → 1251117
You need to log in before you can comment on or make changes to this bug.