-
Notifications
You must be signed in to change notification settings - Fork 395
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Hot reload #1556
Comments
Looking into that. |
glad to hear it's being looked at! you should know - the same issue is happening for me on win10 |
I'm testing hot reload with the latest Flet on Ubuntu 22.04 and it's working quite well: flet-on-ubuntu-22.04-arm.mp4 |
Thanks for looking into this :) NOTE: When the native window starts hanging, the flet process (I highlight it in the htop window in video) takes all cpu of one core. (In this recording the impression gets disturbed by also the screen recorder taking a lot of cpu, but when I'm not recording the highlighted flet process is the dominant cpu consumer) I notice that your video filename indicates that you have an arm processor(?) I have Intel i7 - not sure if that is of any interest. Thankful for any ideas! |
Trying to narrow down the root cause I have tried to reproduce the issue in 4 different environments:
|
Issue is now also reproduced on Raspberry Pi OS (Raspbian based on Debian 11 / Bullseye) on a Raspberry Pi 4 with ARM processor. Before I potentially waste more of our valuable time on this I would highly appreciate if @FeodorFitsner or someone in the community would validate my reproduction procedure shown in the video below. Is this correct installation and use of flet? Or am I misunderstanding something basic here? Video shows installation of flet in a virtual environment on a fresh Ubuntu 22.04 installation, then create and run a basic test app. When saving an update to the app file, hot reload does not work, and flet starts to eat cpu and memory. Thanks :) flet-run-hot-reload-test.mp4 |
@hexbenjamin - Would you be able to demonstrate (for example in a similar video) this issue on win10? I have tested on 2x win10 computers (with Anaconda) and not been able to reproduce there. |
i'm actually more than a little suspicious of the specific computer im encountering the issue on, but ill have a new one this week (ironically). i'll test on the new one and open a new issue if i'm able to reproduce it. will reference this issue if it comes to it! thanks for the help @rkleivel !!! |
So - I really spent some effort trying to digging this down. Added some logging, now the main.py looks like this: import flet as ft
import logging
LOGGING_FORMAT = '%(asctime)s [%(threadName)-20.20s] [%(levelname)-8.8s] %(message)s | %(filename)s: %(funcName)s(), line %(lineno)s'
logging.basicConfig(
filename='example.log',
encoding='utf-8',
level=logging.DEBUG,
format=LOGGING_FORMAT
)
def main(page: ft.Page):
page.add(ft.Text("Hello 4567"))
ft.app(target=main) Mostly the flet app window hangs at the first hot reload attempt, but I was patient and was able to capture a sequence of 2 successful hot reloads, followed by an unsuccessful. Here are the logging results: Start the app with
Then updating main.py with
Again updating main.py with
Once again updating main.py with
Lastly terminating
EvaluationI cannot see anything specific failing other than that Thread-1 starts @FeodorFitsner - are you able to get something useful from this? |
Hello,
Config : |
Assuming it's the same bug then it's NOT related to hot reload.
The SIGTERM does not work as expected and flutter's event loop gets broken or stuck somehow. Didn't dig deeper. Sorry. And as I said it's not a hot reload problem because even without
Can you confirm that @rkleivel ? Thank you. Seem to affect UNIX systems: Linux and MacOS and it's probably a flutter bug. Also a lot of bugreports seem to be a duplicate of this: |
Hot reload never worked for me on macOS native. NOTE: no memory leak observed on macOS native. |
@sausix - I can confirm that behaviour here also. But I do not have the knowledge needed to verify the conclusion you draw from it. |
It's a problem not directly related to hot reload. And probably a bug in flutter. That's an important step and you helped to confirm that. |
Try this and let me know please: |
I also have this issue with hot reloading in ubuntu 23.10. I followed the instructions in your article and my problem still remains |
Works flawless for me on macOS. Thanks for the solution! |
Thanks, @ndonkoHenri - I can confirm that this workaround works for me. Targeting the app with Screencast.from.2023-12-13.09-53-16.mp4Another observation that could be worth mentioning: |
Definitely, @rkleivel ! |
Description
First! Thanks so much for an AWESOME library 馃憤
I cannot seem to get hot reload work reliably in Ubuntu native window.
Code example to reproduce the issue:
Using the counter example from flet docs:
Describe the results you received:
flet run counter.py
the app stops responding if I change the code (for example just adding a blank line) and save (see screenshot below)flet run --web --port 1234 counter.py
the app reloads with new code after saving change as expected.Waiting long enough I sometimes get a response like this
Describe the results you expected:
Would expect hot reload in OS native window to work like in browser
Additional information you deem important (e.g. issue happens only occasionally):
It seems to work as expected like 1 of 20 times.
Flet version (
pip show flet
):Operating system:
Reproduced on 2 different computers:
Additional environment details:
The text was updated successfully, but these errors were encountered: