gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com/
Apache License 2.0
6.97k stars 308 forks source link

Cannot recover from long-running formula #645

Open samkhal opened 1 year ago

samkhal commented 1 year ago

I have a formula which is taking a long time to run. It's running on a table of 1k rows and the formula is

col_ids = [col.col_id for col in table.table.all_columns.values() if not col.col_id.startswith("gristHelper_")]
return '\n'.join(col_ids)

Initially, I just saw the "still working" dialog. Now I seem to be in an unresponsive state for 20 minutes:

dsagal commented 1 year ago

There is a somewhat hidden way to recover from a data engine that's in an infinite loop. Go to document "Settings" page (in the bottom right of the left panel), and find the Engine setting there:

image

Click the ☠️ icon. It kills the data engine, and causes the document to reload. You should see the version before your change that introduced the infinite loop.

samkhal commented 1 year ago

10 hours later, still broken. I cannot access document settings; the page looks like this:

image

I can access the sidebar from within an earlier snapshot. If I click the skull, the page reloads with a message: "Too many backlogged requests for document"

dsagal commented 1 year ago

OK, apologies. It looks like the document got into a bad state while getting closed. I think there is a genuine bug that allows an infinite loop to interfere with shutdown. We shut down the data engine forcibly on the server side, so if you re-open it, it should work again.

If you are still having trouble, could you please share access to the document with support@getgrist.com? (You can find instructions for how to share from the docs homepage without having to open it at https://support.getgrist.com/sharing/.)

samkhal commented 1 year ago

The document works again for me.