At the moment, the use of scheduleOrThrowOnError doesn't currently
have a timeout. So if you reach a point of saturation and use all
threads available in the global pool, threads block infinitely
and lead to a deadlock.
This changes that behaviour so that MergeTree data selector threads
will have a timeout and return a "No threads available" exception
to clients.
Credit to Nikita Mikhaylov for the proposition here:
https://github.com/ClickHouse/ClickHouse/pull/56431