Skip to content
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

Set status to idle after formatters run, not before #1868

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

akshayka
Copy link
Contributor

This PR modifies the cell state machine to count the cell as "running" when output formatters are running.

Sometimes formatters can take a very long time — today, this happens when outputting a very large list or dict. Before this change, formatters that took a long time would lock the kernel without any UI indication in the frontend, making the notebook appear to be broken.

This has the side-effect of making a formatter interruptible, which is helpful if the formatter is taking a very long time to run.

Re: lists/dicts formatting, we should probably lists/dicts/tuples when outputting very large ones, to avoid locking the kernel, but can handle that in another PR.

Draft because haven't tested thoroughly.

formatters can take a long time

makes interruption behavior weird however -- descendants don't get
canceled if a formatter is interrupted
Copy link

vercel bot commented Jul 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 6:54am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 6:54am

)
assert m4[1]["status"] == "idle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this fixes also what i thought was a bug which is "why are there more idle messages, if its already idle". its clearer/cleaner that "running" is repeated

@akshayka akshayka marked this pull request as ready for review July 24, 2024 18:07
@akshayka akshayka merged commit 7b63904 into main Jul 24, 2024
31 checks passed
@akshayka akshayka deleted the aka/status-idle-after-formatting branch July 24, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants