Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle JsonRpcService startup failure #27075

Merged
merged 1 commit into from Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/replay_stage.rs
Expand Up @@ -397,9 +397,9 @@ impl ReplayStage {
drop_bank_sender: Sender<Vec<Arc<Bank>>>,
block_metadata_notifier: Option<BlockMetadataNotifierLock>,
log_messages_bytes_limit: Option<usize>,
) -> Self {
) -> Result<Self, String> {
let mut tower = if let Some(process_blockstore) = maybe_process_blockstore {
let tower = process_blockstore.process_to_create_tower();
let tower = process_blockstore.process_to_create_tower()?;
info!("Tower state: {:?}", tower);
tower
} else {
Expand Down Expand Up @@ -940,10 +940,10 @@ impl ReplayStage {
})
.unwrap();

Self {
Ok(Self {
t_replay,
commitment_service,
}
})
}

fn check_for_vote_only_mode(
Expand Down
11 changes: 6 additions & 5 deletions core/src/tvu.rs
Expand Up @@ -129,7 +129,7 @@ impl Tvu {
accounts_background_request_sender: AbsRequestSender,
log_messages_bytes_limit: Option<usize>,
connection_cache: &Arc<ConnectionCache>,
) -> Self {
) -> Result<Self, String> {
let TvuSockets {
repair: repair_socket,
fetch: fetch_sockets,
Expand Down Expand Up @@ -288,7 +288,7 @@ impl Tvu {
drop_bank_sender,
block_metadata_notifier,
log_messages_bytes_limit,
);
)?;

let ledger_cleanup_service = tvu_config.max_ledger_shreds.map(|max_ledger_shreds| {
LedgerCleanupService::new(
Expand All @@ -301,7 +301,7 @@ impl Tvu {
)
});

Tvu {
Ok(Tvu {
fetch_stage,
shred_sigverify,
retransmit_stage,
Expand All @@ -313,7 +313,7 @@ impl Tvu {
voting_service,
warm_quic_cache_service,
drop_bank_service,
}
})
}

pub fn join(self) -> thread::Result<()> {
Expand Down Expand Up @@ -450,7 +450,8 @@ pub mod tests {
AbsRequestSender::default(),
None,
&Arc::new(ConnectionCache::default()),
);
)
.expect("assume success");
exit.store(true, Ordering::Relaxed);
tvu.join().unwrap();
poh_service.join().unwrap();
Expand Down