RFC: custom thread pool
RPC: custom thread pool
Right now, jraft use global thread pool to execute callback closures or send log entries as below:
- https://github.com/sofastack/sofa-jraft/blob/4f9f779988243bbe80c5a18b920807c320b67f3c/jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/impl/core/DefaultRaftClientService.java#L63
- https://github.com/sofastack/sofa-jraft/blob/4f9f779988243bbe80c5a18b920807c320b67f3c/jraft-core/src/main/java/com/alipay/sofa/jraft/util/Utils.java#L108
The users can't change the thread pool behaviour by themself except setting enviroment variable such as -Djraft.closure.threadpool.size.max=xxx etc. And when using multi raft group in one java process, the global thread pool can't provide any isolations between groups and make the service not robust enough.
So i think we can provide a way to let users custom thread pool for every raft group just like StorageOptionsFactory. If the users doesn't provide a custom thread pool, we use the global one as before.
- Main goals:
- Let user custom closure execution and sending entries thread pools
- Provides isolation between raft groups in one java process.
hi, i want to perform this task
@farawayliu Sure! Feel free to try it.
i have finished send AppendEntries, i have a question, why shutdown programs can't share CLOSURE_EXECUTOR?
https://github.com/sofastack/sofa-jraft/pull/855
i have finished send AppendEntries, i have a question, why shutdown programs can't share CLOSURE_EXECUTOR? #855
hah, i misunderstood the meaning of CLOSURE_EXECUTOR
@killme2008 hi, i have completed this task, please review. https://github.com/sofastack/sofa-jraft/pull/855
@farawayliu Cool, i will review it today.