-
Notifications
You must be signed in to change notification settings - Fork 840
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
Eventual exception when updating Log
from from a threader worker
#3537
Comments
What is the contents of "test.txt" ? |
Literally, just a plain text file; in this case built up with lorem ipsum. |
Was it multiple lines or one single line? |
Multiple lines. Literally just this sort of thing:
repeatedly concatenated until the file was large enough to reproduce the failure the dev reported. |
I can reproduce that. In the short term, you could recommend reading the entire file writing it in single call to |
I've also noticed that using |
Interesting bug. Not actually related to workers / threadings, as much as it looked like it! |
Yeah, just looking at the PR now and I'm wondering why the same code only displayed the issue when from a worker. |
I suspect its a race condition of sorts. The worker just happened to change the order of things enough to trip the issue. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Coming from a question asked on Discord, it's possible to get an exception when loading up a
Log
with the content of a large file, when doing so from a threaded worker.Given this code:
if I create
test.txt
as a text file around 2.6M in size, when loading up the file I eventually get this chain of exceptions:Often the app will crash with a bell sound and nothing else happens until I do something to cause the app to attempt to refresh (a resize of the terminal being a good example).
If, on the other hand, I run similar code with the same input file, but without updating the
Log
from within a threaded worker:this runs to completion without any issues at all.
The text was updated successfully, but these errors were encountered: