Akshay
Akshay2mo ago

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:
[W 240925 08:18:26 distributor:64] BlockingIOError in distributor receive: [Errno 35] Resource temporarily unavailable
[W 240925 08:18:26 distributor:64] BlockingIOError in distributor receive: [Errno 35] Resource temporarily unavailable
8 Replies
Akshay
AkshayOP2mo ago
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.
nellyg
nellyg2mo ago
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?
Akshay
AkshayOP2mo ago
ah right of course, never mind I would recommend wrapping your plots in mo.ui.altair_chart() and seeing if that fixes it
nellyg
nellyg2mo ago
Okay 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
Akshay
AkshayOP2mo ago
@nellyg — any chance you have uvloop installed in your environment?
Akshay
AkshayOP2mo ago
If you do have uvloop installed, I would be curious whether this PR fixes it for you: https://github.com/marimo-team/marimo/pull/2442
GitHub
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...
nellyg
nellyg2mo ago
I will check on this! That seems like it fixed it! Thank you!
Akshay
AkshayOP2mo ago
Fantastic! It was a bug or bad interaction with uvloop