* revert e263be2000
This commit is contained in:
parent
f4189c0305
commit
bafdb7dd62
|
@ -781,8 +781,8 @@ impl Validator {
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
(
|
||||||
let json_rpc_service = JsonRpcService::new(
|
Some(JsonRpcService::new(
|
||||||
rpc_addr,
|
rpc_addr,
|
||||||
config.rpc_config.clone(),
|
config.rpc_config.clone(),
|
||||||
config.snapshot_config.clone(),
|
config.snapshot_config.clone(),
|
||||||
|
@ -802,14 +802,7 @@ impl Validator {
|
||||||
leader_schedule_cache.clone(),
|
leader_schedule_cache.clone(),
|
||||||
connection_cache.clone(),
|
connection_cache.clone(),
|
||||||
max_complete_transaction_status_slot,
|
max_complete_transaction_status_slot,
|
||||||
)
|
)),
|
||||||
.unwrap_or_else(|s| {
|
|
||||||
error!("Failed to create JSON RPC Service: {}", s);
|
|
||||||
abort();
|
|
||||||
});
|
|
||||||
|
|
||||||
(
|
|
||||||
Some(json_rpc_service),
|
|
||||||
if !config.rpc_config.full_api {
|
if !config.rpc_config.full_api {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -354,7 +354,7 @@ impl JsonRpcService {
|
||||||
leader_schedule_cache: Arc<LeaderScheduleCache>,
|
leader_schedule_cache: Arc<LeaderScheduleCache>,
|
||||||
connection_cache: Arc<ConnectionCache>,
|
connection_cache: Arc<ConnectionCache>,
|
||||||
current_transaction_status_slot: Arc<AtomicU64>,
|
current_transaction_status_slot: Arc<AtomicU64>,
|
||||||
) -> Result<Self, String> {
|
) -> Self {
|
||||||
info!("rpc bound to {:?}", rpc_addr);
|
info!("rpc bound to {:?}", rpc_addr);
|
||||||
info!("rpc configuration: {:?}", config);
|
info!("rpc configuration: {:?}", config);
|
||||||
let rpc_threads = 1.max(config.rpc_threads);
|
let rpc_threads = 1.max(config.rpc_threads);
|
||||||
|
@ -523,29 +523,28 @@ impl JsonRpcService {
|
||||||
e,
|
e,
|
||||||
rpc_addr.port()
|
rpc_addr.port()
|
||||||
);
|
);
|
||||||
close_handle_sender.send(Err(e.to_string())).unwrap();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let server = server.unwrap();
|
let server = server.unwrap();
|
||||||
close_handle_sender.send(Ok(server.close_handle())).unwrap();
|
close_handle_sender.send(server.close_handle()).unwrap();
|
||||||
server.wait();
|
server.wait();
|
||||||
exit_bigtable_ledger_upload_service.store(true, Ordering::Relaxed);
|
exit_bigtable_ledger_upload_service.store(true, Ordering::Relaxed);
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let close_handle = close_handle_receiver.recv().unwrap()?;
|
let close_handle = close_handle_receiver.recv().unwrap();
|
||||||
let close_handle_ = close_handle.clone();
|
let close_handle_ = close_handle.clone();
|
||||||
validator_exit
|
validator_exit
|
||||||
.write()
|
.write()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.register_exit(Box::new(move || close_handle_.close()));
|
.register_exit(Box::new(move || close_handle_.close()));
|
||||||
Ok(Self {
|
Self {
|
||||||
thread_hdl,
|
thread_hdl,
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
request_processor: test_request_processor,
|
request_processor: test_request_processor,
|
||||||
close_handle: Some(close_handle),
|
close_handle: Some(close_handle),
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn exit(&mut self) {
|
pub fn exit(&mut self) {
|
||||||
|
@ -639,8 +638,7 @@ mod tests {
|
||||||
Arc::new(LeaderScheduleCache::default()),
|
Arc::new(LeaderScheduleCache::default()),
|
||||||
connection_cache,
|
connection_cache,
|
||||||
Arc::new(AtomicU64::default()),
|
Arc::new(AtomicU64::default()),
|
||||||
)
|
);
|
||||||
.unwrap();
|
|
||||||
let thread = rpc_service.thread_hdl.thread();
|
let thread = rpc_service.thread_hdl.thread();
|
||||||
assert_eq!(thread.name().unwrap(), "solana-jsonrpc");
|
assert_eq!(thread.name().unwrap(), "solana-jsonrpc");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue