Skip to content

Commit

Permalink
relax 'no good candidates' errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Oct 23, 2023
1 parent edbafb5 commit 9e9f28a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/corro-agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2258,8 +2258,6 @@ pub enum SyncClientError {
Io(#[from] std::io::Error),
#[error(transparent)]
Pool(#[from] SqlitePoolError),
#[error("no good candidates found")]
NoGoodCandidate,
#[error("could not decode message: {0}")]
Decoded(#[from] SyncMessageDecodeError),
#[error("could not encode message: {0}")]
Expand Down Expand Up @@ -2321,7 +2319,7 @@ async fn handle_sync(agent: &Agent, transport: &Transport) -> Result<(), SyncCli
};

if candidates.is_empty() {
return Err(SyncClientError::NoGoodCandidate);
return Ok(());
}

debug!("found {} candidates to synchronize with", candidates.len());
Expand Down Expand Up @@ -2351,7 +2349,7 @@ async fn handle_sync(agent: &Agent, transport: &Transport) -> Result<(), SyncCli
};

if chosen.is_empty() {
return Err(SyncClientError::NoGoodCandidate);
return Ok(());
}

let start = Instant::now();
Expand Down Expand Up @@ -2552,9 +2550,7 @@ async fn sync_loop(
}
tripwire::Outcome::Completed(res) => {
if let Err(e) = res {
if !matches!(e, SyncClientError::NoGoodCandidate) {
error!("could not sync: {e}");
}
error!("could not sync: {e}");
// keep syncing until we successfully sync
continue;
}
Expand Down

0 comments on commit 9e9f28a

Please sign in to comment.