python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.39k stars 583 forks source link

When overloaded with calls, Eel dies with "eel.js:115 WebSocket connection to '...' failed: Invalid frame header" #536

Open nosachamos opened 2 years ago

nosachamos commented 2 years ago

Eel version Eel 0.14.0

Describe the bug I still have this issue. It happens when eel seems overloaded with messages.

eel.js:115 WebSocket connection to 'ws://localhost:8080/eel?page=index.html' failed: Invalid frame header

image

Not sure what to do with it right now as this is a total blocker, once it happens Eels just dies.

To Reproduce I have a system in which thousands of calls are made from the Python code to JS code. After a few seconds of this, I get this issue. I don have a repro code that is standalone, but perhaps having method calls in loop would do it.

Expected behavior Eel should not die, or should recover if this happens.

Desktop (please complete the following information): Ubuntu, Chrome

nosachamos commented 2 years ago

I'm wondering if this could be caused by https://github.com/ChrisKnott/Eel/issues/540

vikramsamak commented 1 year ago

is there any solution?? (tweaks)?

emilioh93 commented 9 months ago

I have the same problem apparently

nosachamos commented 9 months ago

I made a PR to fix this but it was never merged.

https://github.com/python-eel/Eel/pull/542

There is a memory leak actually. This PR fixes it and I have a system running it with billions of calls done continuously and no issues.

The project seems abandoned actually... I'm using my own fork with this fix instead. No more problems.

emilioh93 commented 9 months ago

It's great that you found a way to fix it. It really strikes me that it stopped working suddenly, but I will look into your solution to understand more about the origin of the problem. Thank you very much for answering my message @nosachamos

nosachamos commented 9 months ago

You bet, good luck!

zhaoyuzhi983 commented 6 months ago

I'm also having this issue, but I don't have any issues when debugging in the IDE, the problem appears quickly after packaging, and as long as the eel is triggered frequently, I will have a similar problem