The ydb_stm_thread() routine uses too much CPU
Final Release Note
No release note needed because no user-visible impact [#451 (closed)]
Description
The ydb_stm_thread() does a 1us (micro-second) sleep at the top of its processing loop. This is the only sleep that slows the loop down. In fact the sleep's purpose is to keep the loop increment variable from incrementing too fast. The suggestion has been made to change this sleep. If it loops back up not having done anything, double the sleep on each iteration until it reaches a maximum of 1ms (milli-second) - which only takes about 10 iterations.
There are some complications in doing that which also need to be looked as there is code in this loop that expects the increments to be 1us and expects total sleep to be less than 1ms, which it may not be if the sleep is 1ms. This is in the section trying to rate-limit wakeups of threads the signal is being forwarded to.
Draft Release Note
No user-visible impact. This is because the 1 micro-second sleep (which was the issue) was introduced as part of #420 (closed) which happened only after r1.24. Ideally, #451 (closed) should never have been created and !606 (merged) should have instead used #420 (closed) in the commit message.