v.23.7Improvement

Properly check limit for sleepEachRow function and add function_sleep_max_microseconds_per_block setting

Properly check the limit for the sleepEachRow function. Add a setting function_sleep_max_microseconds_per_block. This is needed for generic query fuzzer. #49343 (Alexey Milovidov).
Improved the sleepEachRow function by properly enforcing a maximum sleep time limit per block using a new setting function_sleep_max_microseconds_per_block.

Why it matters

This feature addresses the need to control the maximum amount of time the sleepEachRow function can delay execution per data block, preventing excessive query runtimes and improving robustness. It is particularly useful for generic query fuzzers that simulate query execution delays without risking long-running queries.

How to use it

Users can enable this control by setting the function_sleep_max_microseconds_per_block parameter to a desired microsecond value, which limits the total sleep duration the sleepEachRow function can induce per block processed in a query.