Skip to content

Introduce rendering timeout to Banzai SyntaxHighlight filter

Brett Walker requested to merge bw-introduce-targeted-markdown-timeout into master

What does this MR do and why?

Certain filters in the Banzai pipeline, such as the SyntaxHightlightFilter, can run exceedingly long. Use a timeout around the filter to limit it.

When a filter times out, we don't need to kill the entire pipeline, providing a poor user experience. We will try to use any work that is already completed, and allow the pipeline to continue.

Related to #353623 (closed) and #365358 (comment 992905921)

How to set up and validate locally

  1. make sure the feature flag is enabled, Feature.enable(:markup_rendering_timeout)
  2. grab the file from #353623 (comment 1166572436)
  3. copy/paste it's contents into a comment field
  4. select "Preview"
  5. notice that the first code block is syntax highlighted, the second once is not, and neither is the third.
  6. check the file into the repository, and verify that viewing it also shows the same styling as above.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Brett Walker

Merge request reports

Loading