Skip to content

search: fix regression where search result highlighting is not bailed out after 3s

Warren Gifford requested to merge sg/search-highlight-timeout into master

Created by: slimsag

Prior to this change there was a major regression in which we would disable the syntax highlighting timeout outright. This is despite the fact that this should only ever be done when the user has communicated an intent to wait longer for search results.

This regression meant that when a search turned up files that the syntax highlighter could not highlight quickly, we would just wait for them until it finished. In one customer environment I observed search results taking 30s+ to load due to this because it had the added negative consequence of us not canceling those poorly performing requests which led to syntect_server trying to perform tons of CPU-intensive requests which harmed other requests it was handling.

After this change, we are properly bailing out once again after the syntax highlighting timeout.

This means that in this bad case you are waiting 3s then getting plaintext results instead of waiting 30s+ for highlighting.

Fixes #4268 (closed)

Test plan: Manually tested using #4364, in the future we will e2e test it.

Merge request reports

Loading