frontend: avoid being starved by CPU-intensive tasks #9019
Labels
component/frontend
Protocol, parsing, binder.
needs-investigation
no-issue-activity
type/enhancement
Improvements to existing implementation.
More severely, constant-folding this expression causes the frontend unable to establish new connections for further requests, since
tokio
tends to move the IO scheduler to the same worker thread with this session, and an infinite loop starves the IO scheduler so that the main thread listening to the connection cannot be woken again! 😨Although we should definitely fix this issue, it's also possible that the optimizer becomes more complicated and CPU-intensive. This might be relieved by using a separate runtime for frontend sessions (like #4756), but the stuck is inevitable when worker threads are exhausted (note that CPU-intensive tasks cannot be canceled). Or, we need
spawn_blocking
orblock_in_place
in every possible blocking code.cc @liurenjie1024 @wangrunji0408
Originally posted by @BugenZhao in #8949 (comment)
The text was updated successfully, but these errors were encountered: