Introduce rendering timeout to Banzai SyntaxHighlight filter
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
- make sure the feature flag is enabled,
Feature.enable(:markup_rendering_timeout)
- grab the file from #353623 (comment 1166572436)
- copy/paste it's contents into a comment field
- select "Preview"
- notice that the first code block is syntax highlighted, the second once is not, and neither is the third.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Brett Walker