Possible connection leak? A new SSE connection is opened on every onerror status=undefined
See original GitHub issueHi @Yaffle need your help in figuring this out. I see a pattern where a new connection is opened on every onerror
and the status for the on error is status=undefined
. The client does not get any data through SSE connection and after few seconds onerror
with status=undefined
is invoked again and a new connection is made to the backend.
All these connections kept open till the browser/session is closed and all the connections are closed together.
Could you please help in figuring this out and understand why this is happening and help in fixing it?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Is an EventSource (SSE) supposed to try to reconnect ...
On Chrome 35 or Opera 22, if you lose your connection to the server, it will try to reconnect indefinitely every few seconds...
Read more >Using server-sent events - Web APIs | MDN
The server-sent event API is contained in the EventSource interface; to open a connection to the server to begin receiving events from it, ......
Read more >HTML5 Server-Sent Events and Examples - Sweetcode.io
Each SSE connection has a state with the following possible values: CONNECTING: The connection has not been established, or is currently being established....
Read more >Server-Sent Events (SSE) in Spring 5 with Web MVC and Web ...
SSE client: EventSource interface. To open a connection, it should be created an EventSource object. var eventSource = new EventSource('/sse);.
Read more >Issues - EventSource - Yaffle - Geeks
Possible connection leak? A new SSE connection is opened on every onerror status=undefined. #144 opened 3 years ago by akaskj.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Yaffle I can, thanks. Sadly, my error was due to a bug in our production deployment where my keep-alives weren’t getting through in specific instances. Fixing those has alleviated the triggering of this error message in most cases.
I will try it and cause the error a few times and report back.
@Yaffle Sorry it’s taken me a bit. I see an error message explaining the issue and a call stack. Seems good to me.
Since you say ‘Reconnecting’ I’m guessing I don’t need to re-open the connection manually (which I’m currently doing).
We send a keep-alive every 25 seconds…so I’ll have to look into why that isn’t being found by the polyfilll as I can confirm it’s sent. That seems to be an entirely separate issue from this, though.