BlockingIOError in edit mode
Posted by @nellyg
I am finding that quite frequently (and randomly) I am getting things getting stuck trying to display if they are large outputs (an accordion of multiple altair charts for example)
And I am seeing this output in the console:
8 Replies
We fixed this in run mode. Fixing it in edit mode is trickier but I think I can do it.
Out of curiosity, have you increased
MARIMO_OUTPUT_MAX_BYTES
In the meantime, if you wrap your altair charts in mo.ui.altair_chart
, I think the outputs should be much smaller (we store the data on the backend, whereas altair serializes it as JSON by default), but let me know if it isn't
Additionally, can you please post the full stackt trace?
I tried reproducing with an accordion of altair charts but couldn't —
- without increasing MARIMO_OUTPUT_MAX_BYTES
, i hit the max bytes image but couldn't
- increasing MARIMO_OUTPUT_MAX_BYTES
, I kept on increasing the number of plots. I never saw the blocking IO error but eventually the frontend crashed.
any help in reproducing would be appreciated.Let me see if I can reproduce it for you. I do have MARIMO_OUTPUT_MAX_BYTES set really high. It is weird because my app has ~10 different accordions. On any given run it is likely that ~8 work and 1 or 2 freeze forever
There is no full stack trace anywhere. Is there some debug variable I can set to see more?
ah right of course, never mind
I would recommend wrapping your plots in
mo.ui.altair_chart()
and seeing if that fixes itOkay I will give that a try and let you know. Thanks
That did in fact seem to work. Thanks!
Ah wait. Nope. I still have some hanging. Let me see if I can reproduce something for you
@nellyg — any chance you have
uvloop
installed in your environment?If you do have
uvloop
installed, I would be curious whether this PR fixes it for you: https://github.com/marimo-team/marimo/pull/2442GitHub
Force asyncio in edit mode by akshayka · Pull Request #2442 · marim...
Under uvloop, reading the socket we monitor under add_reader() occasionally throws BlockingIOError (errno 11), even though our socket is blocking and doesn't have a receive timeout
RUN mode...
I will check on this!
That seems like it fixed it! Thank you!
Fantastic! It was a bug or bad interaction with uvloop