WIP fix the occasional stuck RPC request

This commit is contained in:
Ryo Onodera 2021-01-16 23:07:50 +09:00 committed by Michael Vines
parent a12ede8e7d
commit 5cf9094bb9
1 changed files with 10 additions and 1 deletions

View File

@ -358,6 +358,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())
@ -376,7 +384,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,
]))