EventSource (Server Sent Event) doesn't retry after OS suspend/resume
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: duanyao.ustc, Unassigned)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0 Build ID: 20160210153822 Steps to reproduce: 1. Run a SSE server. You can run the attached `sse-test.js` with node.js. Tested with node.js 5.4.1 on Windows 7 and Windows 10 64bit. 2. Load the attached `EventSource-test.htm`. You need to adjust the server URL accordingly. Tested with Firefox 44 and 46 on Windows 7 and Windows 10 64bit. The EventSource object in `EventSource-test.htm` should work correctly, and show "onmessage: hello!" in console. 3. Suspend the computer that running `EventSource-test.htm`, and resume seconds later. See the console. Actual results: The Firefox console shows: onerror EventSource-test.htm:8:3 readyState:2 EventSource-test.htm:9:3 The connection to http://<server-address>:7017/ was interrupted while the page was loading. So the EventSource object turned into CLOSED(2) state, and won't retry. Expected results: The EventSource object should retry after suspend and resume.
I tested with
Updated•8 years ago
|
Comment 4•7 years ago
|
||
Sorry it's been a while here. I think this would have a chance of moving forward if you could host the example somewhere, Duan. Can you do that? If you want it to be private, you can email me the URL/credentials. Thanks!
Updated•7 years ago
|
Hi, the example is already in the attachments, i.e. sse-test.js is the SSE server and `EventSource-test.htm` is the client. See #0 for the usage.
Comment 6•7 years ago
|
||
Sorry, I should have been more clear: it'll be easier to get someone to look at this if they don't have to run node locally.
I found this example: http://demo.howopensource.com/sse/ and Firefox 57 on Linux still reproduce this issue.
Assignee | ||
Updated•5 years ago
|
Comment 8•4 years ago
|
||
I can confirm/reproduce this bug on Firefox 75.0 Linux and Windows 10.
Basically, when the machine wakes-up, Firefox closes all the EventSource
connections.
It behaves as if EventSource.close()
was called by the page
while it is not event present in the code.
This issue doesn't occur with Chrome 81, the serve never receive the close directive on wake-up.
This bug makes Firefox unsuitable for the use of EventSource
.
Comment 9•4 years ago
|
||
Dragana, how are necko request supposed to work in suspend/resume case?
Like what kinds of error might we get?
https://searchfox.org/mozilla-central/rev/2cd2d511c0d94a34fb7fa3b746f54170ee759e35/dom/base/EventSource.cpp#735,756,765
Comment 10•4 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #9)
Dragana, how are necko request supposed to work in suspend/resume case?
Like what kinds of error might we get?
https://searchfox.org/mozilla-central/rev/2cd2d511c0d94a34fb7fa3b746f54170ee759e35/dom/base/EventSource.cpp#735,756,765
It is NS_ERROR_ABORT. (not very descriptive)
Updated•2 years ago
|
Description
•