Skip to content

avoid IDE hang with excessive console output (#5518) - #5528

Merged
jmcphers merged 1 commit into
masterfrom
bugfix/notebook-output-truncation
Oct 17, 2019
Merged

jmcphers merged 1 commit into
masterfrom
bugfix/notebook-output-truncation

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

This is a bandaid for #5518. We limit the number of CSV lines processed in our console output to 10000 entries, to guard against somewhat pathological cases where the user has printed many lines of console output.

@kevinushey

Copy link
Copy Markdown
Collaborator Author

A more thorough fix for this would involve virtualization of console output, but that's far too risky to consider for a v1.2-patch backport. This should be safe enough.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems reasonable. Should we make the maximum value a preference so server admins could adjust the value via rsession.conf?

@jmcphers

jmcphers commented Oct 9, 2019

Copy link
Copy Markdown
Member

Do you think it'd be worth scoping this behavior to the case where the chunk output is appearing in the editor? Chunks outputs can be popped out into their own windows, and those might provide a good place to dump unbounded text (since doing so won't slow down the main UI). That'd be a nice escape hatch for users who for some reason do need to see thousands of lines of output, and would also enable us to set a more aggressive default threshold for the output displayed in the editor.

@kevinushey
kevinushey force-pushed the bugfix/notebook-output-truncation branch 2 times, most recently from 038a88d to aa6484f Compare October 16, 2019 21:20
@kevinushey
kevinushey force-pushed the bugfix/notebook-output-truncation branch from aa6484f to 9c9246f Compare October 16, 2019 21:21
@kevinushey

Copy link
Copy Markdown
Collaborator Author

I've updated the PR to perform client-side truncation of output, with the amount of output also controlled by whether it's being displayed in a satellite window or not.

I still set a somewhat conservative limit, as attempting to load more than 10k lines still appears to hang that window.

@kevinushey

Copy link
Copy Markdown
Collaborator Author

Also note that this only affects restored chunk outputs. Streamed outputs (e.g. if you're currently executing something in the IDE) is not effected. Do you think we should try to make the behavior in each case uniform?

@jmcphers

Copy link
Copy Markdown
Member

If 2k lines of output make the DOM unusably slow, then yes, it'd be nice to start tossing lines if we hit the limit. But that's significantly more work, and since this change is already in bandaid territory (and a patch backport candidate) I like this simple approach.

@jmcphers
jmcphers merged commit c60306f into master Oct 17, 2019
@valerie-rstudio
valerie-rstudio deleted the bugfix/notebook-output-truncation branch January 21, 2022 17:31
@timtmok timtmok mentioned this pull request Oct 31, 2022
4 tasks done
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.

3 participants