WIP fix the occasional stuck RPC request

(cherry picked from commit 5cf9094bb9)
This commit is contained in:
Ryo Onodera
2021-01-16 23:07:50 +09:00
committed by Michael Vines
parent 2e31f4d8f7
commit 008e387381

View File

@ -357,6 +357,14 @@ impl JsonRpcService {
let ledger_path = ledger_path.to_path_buf();
let runtime01 = {
use tokio_01::runtime::{Builder as RuntimeBuilder, Runtime, TaskExecutor};
RuntimeBuilder::new()
.name_prefix("rpc")
.build()
.unwrap()
};
let (close_handle_sender, close_handle_receiver) = channel();
let thread_hdl = Builder::new()
.name("solana-jsonrpc".to_string())
@ -375,7 +383,8 @@ impl JsonRpcService {
io,
move |_req: &hyper::Request<hyper::Body>| request_processor.clone(),
)
.threads(rpc_threads)
.event_loop_executor(runtime01.executor())
.threads(1)
.cors(DomainsValidation::AllowOnly(vec![
AccessControlAllowOrigin::Any,
]))