mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-31 04:10:38 +00:00
feat: remove dedicated runtime for grpc, mysql and pg protocols (#4436)
* feat: remove dedicated runtime for grpc, mysql and pg protocols Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove other runtimes Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * spawn compact task into compact_runtime Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * refine naming Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * Update src/servers/tests/mysql/mysql_server_test.rs Co-authored-by: Zhenchi <zhongzc_arch@outlook.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * turnoff fuzz test matrix fail fast option Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * chore: update rt config for ci tests --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Zhenchi <zhongzc_arch@outlook.com> Co-authored-by: Weny Xu <wenymedia@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ where
|
||||
F: FnOnce() -> R + Send + 'static,
|
||||
R: Send + 'static,
|
||||
{
|
||||
common_runtime::spawn_blocking_bg(f)
|
||||
common_runtime::spawn_blocking_global(f)
|
||||
}
|
||||
|
||||
/// Please only use this method because you are calling from (optionally first as async) to sync then to a async
|
||||
@@ -50,7 +50,7 @@ where
|
||||
F: Future<Output = T> + Send + 'static,
|
||||
T: Send + 'static,
|
||||
{
|
||||
let rt = common_runtime::bg_runtime();
|
||||
let rt = common_runtime::global_runtime();
|
||||
// spawn a thread to block on the runtime, also should prevent `start a runtime inside of runtime` error
|
||||
// it's ok to block here, assume calling from async to sync is using a `spawn_blocking_*` call
|
||||
std::thread::spawn(move || rt.block_on(f)).join()
|
||||
|
||||
Reference in New Issue
Block a user