Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome - net::ERR_CONNECTION_REFUSED - memory full #29

Open
inillaug opened this issue Dec 8, 2020 · 2 comments
Open

Chrome - net::ERR_CONNECTION_REFUSED - memory full #29

inillaug opened this issue Dec 8, 2020 · 2 comments

Comments

@inillaug
Copy link

inillaug commented Dec 8, 2020

Hello manatlan,

I i run for example testEmit.py in server mode instead of app mode.

if name == "main":
#Emit( ).run()
Emit( ).serve(open=False, port=8000 ,log=False, autoreload=False)

If i close the server the Chrome console give me the following error:

Emit_2a1a630-js:9 WebSocket connection to 'ws://127.0.0.1:8000/Emit_2a1a630-ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

After 5 minutes Chrome become unusable, the memory consumption encrease and the console give me the following error:

Emit_2a1a630-js:9 WebSocket connection to 'ws://127.0.0.1:8000/Emit_2a1a630-ws' failed: Unknown reason
setupWS @ Emit_2a1a630-js:9
(anonymous) @ Emit_2a1a630-js:57

The only way to avoid this modify guy.py at line 896;

ws.onclose = function(evt) {
    guy.log("** WS Disconnected");
    //setTimeout( function() {setupWS(cbCnx)}, 500);
};
ws.onerror = function(evt) {
    guy.log("** WS Disconnected");
    //setTimeout( function() {setupWS(cbCnx)}, 500);

Do you think this is interesting for others?
May be an option like app.serve(... , autoreloadws=True/False)?

@manatlan
Copy link
Owner

really interesting ...
in fact, the guy/js on client/side(when your tab is always opened) will try to reconnect indefinitely ...
and I think it can increase the memory consumption ...

The only solution, to avoid this : guy should stop its attempts after a number of tries, or after a delay

@latot
Copy link

latot commented Apr 4, 2021

Maybe, with every try is creating new elements all the time and there the memory consuption, or, with every try lookup a way to clean the memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants