Open Bug 1251117 Opened 8 years ago Updated 2 months ago

EventSource (Server Sent Event) doesn't retry after OS suspend/resume

Categories

(Core :: DOM: Core & HTML, defect, P3)

46 Branch
x86_64
Windows
defect

Tracking

()

UNCONFIRMED

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.
Attached file EventSource-test.htm
test case, client side
I tested with
OS: Unspecified → Windows
Hardware: Unspecified → x86_64
smaug, wdyt?
Flags: needinfo?(bugs)
Whiteboard: btpp-followup-2016-03-03
Whiteboard: btpp-followup-2016-03-03 → btpp-followup-2016-03-10
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!
Flags: needinfo?(bugs) → needinfo?(duanyao.ustc)
Priority: -- → P3
Whiteboard: btpp-followup-2016-03-10
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.
Flags: needinfo?(duanyao.ustc)
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.
Component: DOM → DOM: Core & HTML

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.

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

Flags: needinfo?(dd.mozilla)

(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)

Flags: needinfo?(dd.mozilla)
See Also: → 831392
See Also: → 1251121
See Also: → 1186131
Severity: normal → S3
See Also: → 1882866
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: